Jump to content

Test for Custom Member System for Exploits! :)


Lukeidiot

Recommended Posts

  • 1 month later...

you have some injection use something like

<?php
function connected(){
/* Create a new mysqli object with database connection parameters */
   $mysqli = new mysqli('localhost', 'user','pass','database');

   if(mysqli_connect_errno()) {
      echo "Connection Failed: " . mysqli_connect_errno();
      exit();
   }

}

function clean($text)
{
$text=trim(mysql_real_escape_string(strip_tags($text)));
return $text;
text.=html_entities($text,ENT_QUOTES);
}

$username= clean($_POST['username']);
$login= clean($_POST['login']);
$password=clean($_POST['password']);

//using mysqli prepared statement to escape any other injection
$connect= connected();
$stmt=$connect ->prepare("INSERT INTO table VALUES (:login,:username,:password)")
$stmt ->bindParam(':login',$login);
$stmt ->bindParam(':username',$username);
$stmt ->bindParam(':password',$password);
$stmt ->execute();
?>

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.