mysql - php database data saving -


i making sign form using php when click on register button, saves 1,1 in email , password fields instead of given email , password.

  <?php include("connection.php") ?> <?php  $email=isset($_post['email']); $password=isset($_post['password']);  if(isset($_post['register'])) {     $q= "insert admin (email, password) values ('$email', '$password')";     $qr=mysqli_query($con, $q);     if($qr)     {         echo "data added sucessfully";     }     else     {         die();     } }  ?>  <!doctype html> <html> <head>     <title>log in</title> </head> <body> <form method="post" action=""> <input type="email" name="email"> <br> <input type="password" name="password"> <br> <button type="submit" name="register" value="register">register</button> </form> </body> </html> 

http://php.net/manual/en/function.isset.php

isset function return boolean, try :

if(isset($_post['email'])){     $email=$_post['email']; } if(isset($_post['password'])){     $password=$_post['password']; } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -