Jump to content

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>";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.