+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: ' Error

  1. #1
    ChrDav is offline x10Hosting Member ChrDav is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    15

    ' Error

    Hi,

    My site was working fine up until a month or so ago, now whenever I open a page in the editor it converts all my apostrophes to '. Can this be fixed?

    Everytime I open the editor I have to fix this up.
    An example of my code is below:
    $userselect = mysql_query("SELECT * FROM Users WHERE Username= '$username'") or die(mysql_error());
    which converts to
    $userselect = mysql_query("SELECT * FROM Users WHERE Username= '$username'") or die(mysql_error());
    Thanks,
    Chris.

  2. #2
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: ' Error

    I suspect that this is as a result of copying and pasting.

    WYSIWYG Editors like DW automatically convert code when pasted into the design view.

    If I'm doing work on the core php, I tend to revert back to notepad!

    No editor should convert simply by opening it though!!! :nuts:

    You may find the same problems with "&" and a number of other symbols used in php.

  3. #3
    vol7ron's Avatar
    vol7ron is offline x10 Lieutenant vol7ron is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    DC
    Posts
    434

    Re: ' Error

    are you using the html editor or the regular file editor?
    If you find my post useful please add to my reputation by clicking the +Rep button
    You may also use the Donate link to donate credits - this is appreciated too Thanks to those whom have donated so far!


  4. #4
    tttony's Avatar
    tttony is offline x10 Sophmore tttony is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    ~ 10°10'27.10''' N 67°59'59'.59''' O elev. 457m
    Posts
    147

    Re: ' Error

    its like blogger.com I had problems with the html editor
    PHP & MySQL Web Developer
    Free Domain co.cc

  5. #5
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: ' Error

    if you have access to the script code, then you can do a str_replace(''', ''', $string); or str_replace(''', '\'', $string); depending on what you want it to show. the first one will create an apostrophe using the html code &apos, while the second one will just display an apostrophe in the source, which will be displayed as an apostrophe on the page

  6. #6
    mfurqanabid's Avatar
    mfurqanabid is offline x10Hosting Member mfurqanabid is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    37

    Re: ' Error

    use WYSIWYG Editor, Like FrontPage, Dreamweaver etc.

  7. #7
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: ' Error

    oh, misread your op. just do a search and replace for ' to '. since this is happening in the php code, my first post is useless.

  8. #8
    ChrDav is offline x10Hosting Member ChrDav is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    15

    Re: ' Error

    It doesn't matter whether I open it in the code editor or the HTML editor, it still happens. I change it, then next time I open the file for editing it changes back. I know that I can do the search and replace, however everytime I open the file I have to do it again and this gets extremely annoying. You can't use search and replace in the HTML editor which is extremely annoying.

    Pasting or typing it manually will make no difference.

    This never used to occur until sometime in the last month so maybe something has changed with the servers?

    If I use an external editor, everytime I want to look at my page I have to upload it to the server once again. I do a lot of change something small, reload the page to check it did exactly what I wanted it to do, so this just becomes impractical.

  9. #9
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: ' Error

    Quote Originally Posted by ChrDav View Post
    If I use an external editor, everytime I want to look at my page I have to upload it to the server once again. I do a lot of change something small, reload the page to check it did exactly what I wanted it to do, so this just becomes impractical.
    I do the same as you.

    What software are you using that this has problems with? this could have a number of causes, either with the ftp client, the software, or the server (although i doubt it's the server). I'll take a look at google to see if i can come up w/ anything.


    WAIT!!!
    looking at your op, i'm under the impression that you are using cpanels built-in editor. I would highly suggest using another program to edit with.

    I'm currently using zend studio 6, but that costs money. You can also use aptana studio or eclipse, both of which are free. With them includes a built in ftp client so you don't need an external one (filezilla, cuteftp, etc...)
    Last edited by xPlozion; 12-13-2008 at 09:29 PM.

  10. #10
    ChrDav is offline x10Hosting Member ChrDav is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    15

    Re: ' Error

    What do you mean by what software am I using?

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. 500 Internal Server Error on cossacks
    By tletter in forum Free Hosting
    Replies: 1
    Last Post: 12-03-2008, 07:27 PM
  2. error 500
    By robertofrancos in forum Soporte
    Replies: 10
    Last Post: 12-05-2007, 10:42 AM
  3. Error en mi host
    By roonline in forum Soporte
    Replies: 17
    Last Post: 11-14-2007, 03:28 PM
  4. 500 Internal Server Error (PHP Error?)
    By aniklaus in forum Free Hosting
    Replies: 3
    Last Post: 11-12-2007, 11:47 AM
  5. Internal Sever Error
    By Gun Mac in forum Free Hosting
    Replies: 0
    Last Post: 09-19-2005, 03:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers