Jump to content

Anti-SQL Injection. 99% Safe! (recommended)


regenx

Recommended Posts

Hi, with this php function you can stop 99% from SQL injections on your php register page.

From today you are safe! Trust me. I recommend you to use this function...

function madSafety($string) {

$string = stripslashes($string);

$string = strip_tags($string);

$string = mysql_real_escape_string($string);

return $string;

}

Link to comment
Share on other sites

  • 3 weeks later...

<?php

function madSafety($string) {

$string = stripslashes($string);

$string = strip_tags($string);

$string = mysql_real_escape_string($string);

return $string;

}

Your php register code here....

.....

Your end code .....

?>

Something like that ....

Good Luck & Have Fun!

Link to comment
Share on other sites

  • 4 weeks later...

Wh

The best method are prepared statements

What do you mean with prepared statements?

btw...

-- this is wrong way

$string = mysql_real_escape_string($string);

$string = stripslashes($string);

$string = strip_tags($string);

-- this is safe way

$string = stripslashes($string); // Keep your usernames clean

$string = strip_tags($string); // Kill all tags like html tags, etc..

$string = mysql_real_escape_string($string); // Anti-injection

Link to comment
Share on other sites

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

By using this site, you agree to our Terms of Use.