Included dbh and signup file

This commit is contained in:
Ismail Cadaroski 2017-01-11 20:21:27 +01:00
parent 5fb868c90d
commit e3a2b8a495
2 changed files with 26 additions and 0 deletions

10
dbh.php Normal file
View File

@ -0,0 +1,10 @@
<?php
<!-- Connection to the Server -->
$conn = mysqli_connect("localhost:4022", "root", "password", "login");
<!-- Connection to the Server end -->
if (!$conn){
die("Connection failed:".mysqli_connect_error());
}
?>

16
signup.php Normal file
View File

@ -0,0 +1,16 @@
<?php
INCLUDE 'dbh.php';
$first = $_POST['first'];
$last = $_POST ['last'];
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];
$sql = "Insert into user (first, last, uid, pwd)
VALUES ('$first', '$last' )";
$result = $mysqli_query($conn, $sql);
header("Location: index.php");
?>