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 - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -