Jump to content

print function is adding / before '


npsari

Recommended Posts

 

hi there everyone,

 

I am using a Noraml HTML form to submit Text

 

When a user clicks on the submit button, a page opens up which previews what the user has typed

 

print"<font color=\"#000000\" Font size=\"3\" Font face=Arial ><b>$Text12</b></font>";

 

But the above little code, always puts an / if the user types ' or "

 

How can i avoid that, why does it put the / symbol before special characters

 

Help guys  :)

 

 

Link to comment
https://forums.phpfreaks.com/topic/66785-print-function-is-adding-before/
Share on other sites

how can i add slashes, i dont understand

 

the $Text12 is a Text area in an HTML form

 

And i use this to echo it

 

print"<font color=\"#000000\" Font size=\"3\" Font face=Arial >$Text12</font>";

 

Users write anything in that Text area

 

but when they put '  the print echos it ok, but puts / before it

Your php setup most probably has a setting called magic_quotes_gpc. This setting will automatically escape quotes within _GET, _POST and _COOKIE data

 

What you'll want to is:

print"<font color=\"#000000\" Font size=\"3\" Font face=Arial >" . stripslashes($Text12) . "</font>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.