#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    43
    Rep Power
    15
    I ran into a problem last night where I am getting a problem with displaying an apostrophe.

    I've tried adding slashes to the field before its inserted into mysql :

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $myvar=addslashes($myvar);
    [/code]

    and I tried removing them right before they are used:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    $myvar=stripslashes($myvar);
    [/code]

    but the page showing the information in $myvar stops displaying anything after the apostrophe, including whatever fields come after that. It does finish drawing the tables and the rest of the "hard coded" HTML, just stops all php3/mysql output.

    Any ideas on how to get past this problem?

    Mike
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Toronto, Canada
    Posts
    13
    Rep Power
    0
    can u see any error message in your php generated page? that might help. try to look in the source (through browser) and see if there is any problem.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    43
    Rep Power
    15
    Actually, the source only showed the output (from the php commands) up to the apostrophe, the rest was all the html code from the page.

    I did fix the problem though, turned out to be when the string with the apostrophe was passed via the post method to the next page, it was getting truncated (sp??) at the apostrophe. After I changed it to pass an ID number instead of a name, and then used PHP to lookup the name and information from MySQL on the second page, it all worked fine, including posting the apostrophe.

    Thanks for the time,
    Mike
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    Don't forget to also use the html_specialchars() function.
    http://www.php.net/manual/function.h...cialchars.php3

Similar Threads

  1. windows XP chkdsk and file system problems
    By wey97 in forum Windows Help
    Replies: 26
    Last Post: August 2nd, 2005, 11:37 PM
  2. Comma delimeted file - problems - Help
    By mel_bagley in forum Visual Basic Programming
    Replies: 14
    Last Post: February 6th, 2004, 03:04 AM
  3. Popup problems from Flash in IE6
    By jmichels in forum Flash Help
    Replies: 19
    Last Post: January 6th, 2004, 03:27 PM
  4. T_String Query
    By KingSwing in forum PHP Development
    Replies: 15
    Last Post: October 11th, 2003, 03:11 AM
  5. Queen mother of quote/apostrophe problems
    By enormoustrouser in forum PHP Development
    Replies: 5
    Last Post: October 8th, 2003, 12:18 PM

IMN logo majestic logo threadwatch logo seochat tools logo