php adding forward slashes to $_get

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

Post Reply
Ralphy
Forum Newbie
Posts: 2
Joined: Thu Mar 03, 2011 6:10 pm

php adding forward slashes to $_get

Post by Ralphy »

Hello, Im using $_get to retrieve some info and it seems to be adding a forward slash to the end of my strings. I turned off magic quotes and stripslashes doesn't seem to work for me.

Anyone got any ideas?

Thank you.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: php adding forward slashes to $_get

Post by John Cartwright »

Did you restart apache after disabling magic quotes?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: php adding forward slashes to $_get

Post by pickle »

Whenever I load data out of $_POST or $_GET, I always check if magic quotes are on and act accordingly:

Code: Select all

$username = (get_magic_quotes_gpc()) ? stripslashes($_GET['username']) : $_GET['username'];
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply