-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateClient.php
More file actions
100 lines (87 loc) · 2.73 KB
/
createClient.php
File metadata and controls
100 lines (87 loc) · 2.73 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
$email = "";
$password = "";
$passConfirm = "";
$type = "C";
$clientName ="";
$baseLocation = "";
$err = false;
if (isset($_POST["submit"])) {
if(isset($_POST["email"])) $email = $_POST["email"];
if(isset($_POST["password"])) $password = $_POST["password"];
if(isset($_POST["passConfirm"])) $passConfirm = $_POST["passConfirm"];
if(isset($_POST["clientName"])) $clientName = $_POST["clientName"];
if(isset($_POST["baseLocation"])) $baseLocation = $_POST["baseLocation"];
if (!empty($email) && !empty($password) && !empty($passConfirm) && !empty($baseLocation) && !empty($clientName))
{
session_start();
$_SESSION["email"] = $email;
$_SESSION["password"] = $password;
$_SESSION["passConfirm"] = $passConfirm;
$_SESSION["clientName"] = $clientName;
$_SESSION["baseLocation"] = $baseLocation;
header("Location: clientCreationConfirm.php");
}
else
{
$err = true;
}
}
?>
<!doctype html>
<head>
<title>Create Client</title>
<style>
.errlabel {color:red;}
</style>
<link rel="stylesheet" href="stylesheet.css" />
</head>
<body>
<div style='margin-left: auto; display: block; margin-right: auto;width: 300px;'>
NEW CLIENT INFORMATION
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"
<label>email:
<input type="text" name="email" value="<?php echo $email; ?>" />
</label>
<br />
<label>password:
<input type="text" name="password" value="<?php echo $password; ?>" />
<?php
if ($err && empty($password)) {
echo "<label class='errlabel'>Please enter a password.</label>";
}
?>
</label>
<br />
<label>Confirm password:
<input type="text" name="passConfirm" value="<?php echo $passConfirm; ?>" />
<?php
if ($err && empty($passConfirm)) {
echo "<label class='errlabel'>Please enter a password.</label>";
}
?>
</label>
<br />
<label>Client Name:
<input type="text" name="clientName" value="<?php echo $clientName; ?>" />
<?php
if ($err && empty($clientName)) {
echo "<label class='errlabel'>Please enter a client name.</label>";
}
?>
</label>
<br />
<label>Base Location:
<input type="text" name="baseLocation" value="<?php echo $baseLocation; ?>" />
<?php
if ($err && empty($baseLocation)) {
echo "<label class='errlabel'>Please enter a Location.</label>";
}
?>
</label>
<br />
<input type="submit" name="submit" value="Submit" />
</br>
<a href=who.html>Return to Account Selection</a>
</div>
</body>