PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Aug 16, 2017 12:30 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jul 09, 2015 4:47 pm 
Offline
Forum Newbie

Joined: Thu Jul 09, 2015 4:36 pm
Posts: 2
Hi everybody,
I am a php developer newbie. I really want to master php in my road on becoming a serious developer. I came to know that the

get_magic_quotes_gpc() function is deprecated in php 5.5 and removed. is there any function that could help in security?

Pleas take a look at this function and give your views. is this code good? Any tips and advise will help

function quote_smart($value, $handle)
{
// Stripslashes
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
// Quote if not integer
if (!is_numeric($value)) {
$value = "'" . mysql_real_escape_string($value, $handle) . "'";
}
return $value;
}

thanks.


Top
 Profile  
 
PostPosted: Thu Jul 09, 2015 6:17 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6268
Location: Montreal, Canada
This code is ancient. mysql_ functions are also deprecated. Look at PDO and prepared statements.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group