Page 1 of 1

html code entered into a form showing up strange in table

Posted: Thu Feb 05, 2009 8:15 pm
by phpstudent
So i have a form that i set up in mysql as a varchar, with 250 character limit. i am able to enter information into this field, but if i submit a url, it comes back strange.

say i enter the following into my form:
check out <a href="http://mysite.com/thispage.php">this page</a> today
once it hits the table it shows like this:
check out <a href=\"http://mysite.com/thispage.php\">this page</a> today
i have tried using varchar and text fields, and neither seems to be working.
any thoughts?
thanks

Re: html code entered into a form showing up strange in table

Posted: Thu Feb 05, 2009 8:21 pm
by John Cartwright
You have magic quotes enabled. It has been explanated a thousands times why it's bad so I won't bother (it even has a page in the manual -- "Why not to use Magic Quotes")

Simple answer: disable magic quotes. This can be done in your php.ini, or htaccess. I'm not sure if it can be configured at runtime (I don't think so).

Re: html code entered into a form showing up strange in table

Posted: Fri Feb 06, 2009 8:48 am
by phpstudent
i disabled them in htaccess and that worked perfectly

thanks for your help, i really appreciate it