-
Notifications
You must be signed in to change notification settings - Fork 0
/
nextpage.php
24 lines (23 loc) · 873 Bytes
/
nextpage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
session_start();
//database connecet
$server = "localhost";
$username = "root";
$pw = "1234";
$database = "gym";
$port = "3306";
//insert data
$link = new mysqli($server, $username, $pw, $database, $port);
if (!$link) {
die("Connection failed: " . mysqli_connect_error());
}
$query = "SELECT * FROM `members` WHERE `name`='" . $_POST['name'] . "'";
echo $query;
$result = mysqli_query($link, $query);
if (mysqli_num_rows($result) < 1) {
$query = "INSERT INTO `members` (`name`,`dob`,`tp`,`nic`,`email`,`gender`,`password`,`memebershipType`) VALUES('".$_POST['name']."','".$_POST['dob']."','".$_POST['tp']."','".$_POST['nic']."','".$_POST['email']."','".$_POST['gender']."','".$_POST['pass']."','".$_POST['memebershipType']."')";
echo $query;
mysqli_query($link, $query);
$_SESSION['username']=$_POST['name'];
header("Location: admin.php");
}