Google Groups Home
Help | Sign in
mysqli_real_escape_string() with array_map()
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
haugland@gmail.com  
View profile
 More options Jan 25 2006, 1:34 am
From: "haugl...@gmail.com" <haugl...@gmail.com>
Date: Wed, 25 Jan 2006 06:34:03 -0000
Local: Wed, Jan 25 2006 1:34 am
Subject: mysqli_real_escape_string() with array_map()
Hey guys,

I've been working on trying to develop a way that would work like using
array_map() to perform mysqli_real_escape_string() on all $_POST data.

Does anyone have any suggestions or solutions to do this?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
haugland@gmail.com  
View profile
 More options Jan 25 2006, 2:09 am
From: "haugl...@gmail.com" <haugl...@gmail.com>
Date: Wed, 25 Jan 2006 07:09:42 -0000
Local: Wed, Jan 25 2006 2:09 am
Subject: Re: mysqli_real_escape_string() with array_map()
I actually resolved this myself.

The solution was this:
function escape_mysqli($value) {
include('db.php'); //change this to your database connection include
$result = mysqli_real_escape_string($db,$value);
return $result;

}

if (get_magic_quotes_gpc()) {
$_POST = array_map('stripslashes',$_POST);
}

$_POST = array_map('escape_mysqli',$_POST);

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google