'magic_quotes_gpc' with multiple form pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
freetheheel
Forum Newbie
Posts: 2
Joined: Tue Dec 30, 2003 3:47 pm

'magic_quotes_gpc' with multiple form pages

Post by freetheheel »

i'm working on a site that has events posted on it. After the initial entering page i have a verify page with hidden fields, and then i have the page that actually enteres the information into the database. my problem is that when the first form is submitted and it goes to the 'verify' page, it inserts the backslash (\) before the single quote. then, after the form is submitted to the 3rd page it adds another \ before both the backslash and the quote. so when the information is finally submitted into the database it ends up as: don''t or can''t.

how do i fix this?
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

As I am a newbie, I'm not sure this will work. Try mysql_escape_string.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

It's best to turn magic quotes off (if you can) to avoid these sorts of issues.

If not there's stripslashes().
freetheheel
Forum Newbie
Posts: 2
Joined: Tue Dec 30, 2003 3:47 pm

Post by freetheheel »

thanks!
Post Reply