Jump to content

panasonic

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by panasonic

  1. Hi Guys, I'm sure you've all but forgotten this string... but it was useful to me today and I thought I'd reciprocate with a little thing I realized. I too was previewing the information before entering into the database and went crazy trying to deal with apostrophes and quotations in the preview string and then getting them into the database. I was trying to string_replace the "'" at one point and it didn't work so your idea of doing it to the whole "\'" escaped apostrophe (because of the magic quote situation) let me realize I could replace it with the html code for an apostrophe! this works: // first we'll fix the magic quotes problem with the apostrophe $description = str_replace("\'"," 8217;",$description); // then pick up all the old values to pass to database on next submit echo "<input type='hidden' name='description' value='$description'>"; Notice I put a space in the middle of the html code for apostrophe so that you would see the code instead of the apostrophe it displays! Be sure to take that space back out if you try to use this little snippet. So... whoever is next to find this string - enjoy! PM
×
×
  • Create New...