Jump to content

[SOLVED] list() and stripslashes


M.O.S. Studios

Recommended Posts

hey guys, im placing all my values into a db with addslashes() around the values,

 

now i want to pull the values and have stripslashes around the valules, the problem is im pulling the values using list(),

 

like this

 

$populate=mysql_query("SELECT * FROM `ppinfo` WHERE `index`=".$_POST['index']);
list($index, $name, $sig, $user, $pass, $account, $url, $live) = mysql_fetch_array($populate);

 

is there any way to have list remove the slashes or do i have to redefine each var one by one??

 

thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/141469-solved-list-and-stripslashes/
Share on other sites

mysql_real_escape_string() escapes all special characters but will not leave the slashes on the string after it has been stored as addslashes() does. mysql_real_escape_string() should always be used on user inputted data for security.

 

addslashes() can be a pain as you may get into a situation where slashes are added to existing slashes and you end up having to use string replace functions to clean them out as stripslashes() only removes the first instance.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.