php - function checkRequest post -


i trying use function check post data agaist mysqli_real_escape_string.

code

function checkrequest($key){     $servername = "localhost";     $username = "johndoe";     $password = "1234";     $database = "anydb";      $key = $_post[$key];      // create connection     $conn = mysqli_connect($servername, $username, $password, $database);     $key = mysqli_real_escape_string($conn, $key);     mysqli_close($conn);     return $key;   }  $client = checkrequest('client'); 

i getting

notice: undefined index: client in /home/www/entry_action.php on line 52 

i cant seem work, looking find did wrong... :-(


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -