-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbabysitter.php
40 lines (38 loc) · 1.65 KB
/
babysitter.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
<?php
if(isset($_POST["submit"])){
$FirstName = $_POST["Fname"];
$LastName = $_POST["Lname"];
$ID = $_POST["ID"];
$age = $_POST["age"];
$gender = $_POST["gender"];
$email = $_POST["email"];
$photo= $_POST["photo"];
$psw = $_POST["psw"];
$phone= $_POST["phone"];
$city= $_POST["Location"];
$bio = $_POST["bio"];
require_once 'DB.php';
require_once 'function.php';
if(phoneExists($conn,$phone)!== false){
header("location: signUpAsBabysitter.php?error= phone number has been already taken!" );
exit();}
if(emailExists($conn,$email) !== false){
header("location: signUpAsBabysitter.php?error= email has been already taken!" );
exit();}
if(idExists($conn,$ID)!== false){
header("location: signUpAsBabysitter.php?error=ID has been already taken!" );
exit();}
if(phoneinvalid($conn,$phone) !== false){
header("location: signUpAsBabysitter.php?error= invalid phone number!" );
exit();}
if(IDinvalid($conn,$ID) !== false){
header("location: signUpAsBabysitter.php?error= invalid ID!" );
exit();}
if(ageinvalid($conn,$age) !== false){
header("location: signUpAsBabysitter.php?error= invalid age!" );
exit();}
createUser($conn,$FirstName,$LastName,$ID,$age,$gender,$email,$photo,$psw,$phone,$city,$bio);
}
else{
header("location:signUpAsBabysitter.php");
}