Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.