Page 1 of 1

Post Submit Quotes Help!

Posted: Wed Mar 28, 2007 2:32 pm
by JustinMs66
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


i have a simple form and i want it to be so that upon submission, it not only displays what the user submitted below, but it keeps what the user submitted inside the text fields. so far it has worked!

Code: Select all

<form action="" method="post">
<textarea rows="9" cols="45" name="text"><?php echo $_POST['text']; ?></textarea>
<input type="text" name="name" style="width:600px;" value="<?php echo $_POST['name']; ?>"/>
<br />
<input type="submit" name="submit" value="Submit"/>
</form>

Code: Select all

<?php
if (isset($_POST['submit'])) {
echo $_POST['name']."<br>";
echo $_POST['text'];
}
?>
again: so far this works.

but when i have quotes " or ' in the text, it replaces it with \" or \' how do i make it Not do that?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Mar 28, 2007 2:59 pm
by feyd
You have magic quotes on. You need to add code that
  1. detects that magic quotes are on
  2. removes the added slashes from submission information
get_magic_quotes_gpc(), stripslashes()