Need Help with signature code

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
cdoyle
Forum Contributor
Posts: 102
Joined: Wed Feb 13, 2008 7:26 pm

Need Help with signature code

Post by cdoyle »

Hi,

I thought I had this right, but I don't think I do.

I'm using ADODB for our game, and I created a page where users can load a signature to display on their profile.
So here is how we insert the sig into the db

Code: Select all

$addsig = $db->execute("UPDATE `players` SET `signature`=? WHERE `id`=?", array($sig, $player->id));
and this is how I display it on the page

Code: Select all

 echo stripslashes(htmlentities($profile['signature'], ENT_QUOTES ));
I thought this would remove the harmful stuff people could put in their sigs, but today I noticed someone put a URL in their sig and the slashers were still there.

What is the proper way to get input from users and to display it.

Thanks
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Need Help with signature code

Post by Darhazer »

stripslashes actually strips backslashes (\)
So what is your goal, you don't want URL's to be displayed in the signature?
Post Reply