-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
22 lines (21 loc) · 720 Bytes
/
signup.php
File metadata and controls
22 lines (21 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include("includes/connect.php");
$uname=$_POST['form-username'];
$emailid=$_POST['form-email'];
$password=$_POST['form-password'];
if($uname!='' && $emailid!=''&& $password!='')
{
$encryptpass=password_hash($password,PASSWORD_DEFAULT);
$euname=rtrim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL,$password,$uname,MCRYPT_MODE_ECB)));
$sql="insert into user1 values ('$euname','$emailid','$encryptpass')";
if(mysqli_query($connect ,$sql)){
header('Location:xyz.html');
}
else
echo "error ". "<br>" . mysqli_error($connect);
}
else
{
echo"<script>alert('Enter both username and password');</script>";
}
?>