Jump to content
Larry Ullman's Book Forums

Oh Man! No Escape_Data Function?


Recommended Posts

I just received the book and I immediately turned to chapter 18 and I noticed that the escape_data function is no longer being used in the mysqli_connect file. That's disappointing.

 

I noticed however, that much of the same proceedure for working through the POST variables includes pretty much everything the escape_data fucntion from the old book (PHP and MySQL for dynamic websites 2nd edition) used.

 

I tried adding an escape data function to the mysqli_connect file but it threw an immediate error. Unexpected "{" (the first one). I guess this function is no longer good with php 5.

 

function_escape_data($data) {

if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}

global $dbc;
$data = mysqli_real_escape_string($dbc, trim($data));

return $data;
}

Link to comment
Share on other sites

  • 1 month later...
 Share

×
×
  • Create New...