Removing \ from $_POST[]'s

General discussions related to php

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Fri Nov 01, 2002 7:36 pm
Location: Mississippi, United States

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\ .. 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.



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

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

Greetz Daan


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

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

Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 4 guests