Click to See Complete Forum and Search --> : PHP POSTing with quotes
dandono
Apr 29th, 2006, 04:41 AM
Hi, I have a normal form with a textbox and if i type something like John said "Hello" then wrote that to a text file and then i opened the text file its contents would say John said /"Hello/" How can i stop this from happening?
Thanks, dandono.
noshaba
Apr 29th, 2006, 05:14 AM
just replace / with blank space bcoz " can't be entered in a string as string is any thing enclosed in quotes...So it converts it in escape sequence ... if u want it not to include / then u need to replace it.
penagate
Apr 29th, 2006, 05:51 AM
If it's \" then you must have magic quotes on. Use stripslashes() to remove backslashes from quotes.
dandono
Apr 29th, 2006, 06:05 AM
I didnt think of that. I thought i had to go through php.ini or something. I used this:
<?php
$text=$_POST['txt'];
$text=str_replace('\"',""",$text);
?>
Thanks, dandono.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.