Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Removing \ from $_POST[]'s

General discussions related to php

Moderators: macek, egami, gesf

Removing \ from $_POST[]'s

Postby CT » Fri Nov 01, 2002 7:39 pm

I've got a problem. I've been developing a forum with PHP and i've noticed. When you submit a message with ' or $, @, etc etc... after the php prints it to a file you get I\'m, or Myname\@hotmail.com .. I've been trying to develop a solution so far i've got..

while(strstr($_POST["msg"], "\\")) {
substr_replace($_POST["msg"], ' ', strpos($_POST["msg"], "\\"));
}

But it loops forever O_o... I need a solution.

CT
http://CmsTechnologies.ath.cx
CmsTecknologys@hotmail.com
CT
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Nov 01, 2002 7:36 pm
Location: Mississippi, United States

Postby DoppyNL » Sat Nov 02, 2002 12:22 am

Use the function stripslashes, wich will remove the /'s for you.

Greetz Daan
DoppyNL
 

Postby Jay » Sat Nov 02, 2002 2:10 am

Or ask your host to turn magic quotes off, they're a menace!!
Jay
 


Return to PHP General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.