-
Notifications
You must be signed in to change notification settings - Fork 1
/
addGirlsController.php
46 lines (36 loc) · 1.09 KB
/
addGirlsController.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
include "db_connect.php";
$requires = "admin";
include "menu.php";
$error = "?";
$firstName = "";
$lastName = "";
$DOB = "";
$address = "";
$street = "";
$city = "";
$state = "VA";
$zip = "";
if($_POST["firstName"] != ""){ $firstName = $_POST["firstName"];
}else { $error .= "firstName&";}
if($_POST["lastName"] != ""){$lastName = $_POST["lastName"];
}else { $error .= "lastName&";}
if($_POST["address"]!=""){ $address = $_POST["address"];
}else { $error .= "address&";}
if($_POST["city"] !=""){$city = $_POST["city"];
}else{$error .= "city&";}
if($_POST["st"] !=""){$state = $_POST["st"];
}else{$error .= "st&";}
if($_POST["zip"] != ""){$zip = $_POST["zip"];
}else{$error .= "zip&";}
if($_POST["DOB"] !=""){$DOB = $_POST["DOB"];
}else{$error .= "DOB";}
if($error != "?"){
header("Location: addGirls.php".$error);
}else {
$query = "INSERT INTO girls (firstName,lastName,DOB,address,city, st,zip) VALUES ('$firstName','$lastName','$DOB','$address', '$city', '$state', '$zip');";
mysqli_query($db, $query);
echo $query;
header("Location: main.php");
}
?>