PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Tue Aug 27, 2002 11:07 am
I've got a message forum on the site I'm making at the moment.
The user adds a message using a standard form.
The message gets saved to a .txt file.
Now, for some reason PHP keeps replacing ' and " symbols with '' and \" ..is there any way to stop this?
I'm using the standard PHP command to strip out any HTML code from the users message.
Any ideas?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Aug 27, 2002 11:43 am
are you using addslashes?
try
htmlentities()
Gen-ik
DevNet Resident
Posts: 1059 Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.
Post
by Gen-ik » Tue Aug 27, 2002 12:33 pm
Thanks.. the stripslashes function worked. Don't know how I missed it in the first place! Oh well.
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Tue Aug 27, 2002 3:15 pm
You have the magic quote in PHP that's why it does that.
gotDNS
Forum Contributor
Posts: 217 Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA
Post
by gotDNS » Wed Aug 28, 2002 9:25 am
Code: Select all
$forminfo = stripslashes($forminfo);
then add $forminfo to the text file.