|
-
Apr 29th, 2006, 04:41 AM
#1
Thread Starter
Hyperactive Member
PHP POSTing with quotes
Hi, I have a normal form with a textbox and if i type something like then wrote that to a text file and then i opened the text file its contents would say
Code:
John said /"Hello/"
How can i stop this from happening?
Thanks, dandono.
If there is only one perfect person in the universe, does that make them imperfect?
-
Apr 29th, 2006, 05:14 AM
#2
Hyperactive Member
Re: PHP POSTing with quotes
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.
-
Apr 29th, 2006, 05:51 AM
#3
Re: PHP POSTing with quotes
If it's \" then you must have magic quotes on. Use stripslashes() to remove backslashes from quotes.
-
Apr 29th, 2006, 06:05 AM
#4
Thread Starter
Hyperactive Member
Re: PHP POSTing with quotes
I didnt think of that. I thought i had to go through php.ini or something. I used this:
PHP Code:
<?php
$text=$_POST['txt'];
$text=str_replace('\"',""",$text);
?>
Thanks, dandono.
If there is only one perfect person in the universe, does that make them imperfect?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|