I have a form which is used for a cms. You enter text into the form, it sends the data to a confirmation page just so you can check for any typos etc. Then it stores the data from the form into a session and passes it onto the update script when the user presses OK. Sometimes this all works great, and the entry in the database. Other times, it doesn't update. Everything is passed onto the confirmation dialogue fine, so it can't be a problem with my form. What I'm puzzled about is why it isn't always updating the database entry correctly. A lot of the time this happens when pasting from notepad, but I can't see why this would be a problem.
My update script:
<? /* $pagename is a way of identifying which record to update in the database. $pageheading is the pageheading data retrieved from a session variable from the confirmation page. $pagetext is the pagetext data retrieved from a session variable from the confirmation page. PageHeading is varchar PageText is mediumtext */ //Update database $query = "UPDATE Main SET PageHeading = '$pageheading', PageText = '$pagetext' WHERE PageName = '$pagename'"; mysql_query($query); echo "Your changes on the $pagename page have been saved."; ?>
Thanks in advance for any help.