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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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