0

this is my signup.php code:

<?php
include "connect.php";
$email = $_POST["email"];
$pass = $_POST["pass"];
$query = "INSERT INTO user(email,pass)VALUES (:email,:pass)";
$res=$connect->prepare($query);
$res->bindParam(":email",$email);
$res->bindParam(":pass",$pass);
$res->execute();

if($res){
    echo $email;
}else{
    echo "error";
}

resault :

enter image description here

Barmar
  • 741,623
  • 53
  • 500
  • 612
Ehsan.A21
  • 3
  • 3
  • Your form is using `method="get"`, so you need to use `$_GET` instead of `$_POST`. – Barmar May 29 '20 at 17:28
  • 1
    Or you should change the form to use `method="post"`, because you don't want passwords to be included in the URL. – Barmar May 29 '20 at 17:29
  • **Never store plain text passwords!x** Please use ***PHP's [built-in functions](http://jayblanchard.net/proper_password_hashing_with_PHP.html)*** to handle password security. If you're using a PHP version less than 5.5 you can use the `password_hash()` [compatibility pack](https://github.com/ircmaxell/password_compat). ***It is not necessary to [escape passwords](http://stackoverflow.com/q/36628418/1011527)*** or use any other cleansing mechanism on them before hashing. Doing so *changes* the password and causes unnecessary additional coding. – Jay Blanchard May 29 '20 at 17:31

0 Answers0