-
Notifications
You must be signed in to change notification settings - Fork 0
/
createTrucker.php
129 lines (114 loc) · 3.54 KB
/
createTrucker.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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
$CDL = "";
$email = "";
$password = "";
$passConfirm = "";
$type = "T";
$firstName = "";
$lastName = "";
$city = "";
$state = "";
$err = false;
if (isset($_POST["submit"])) {
if(isset($_POST["CDL"])) $CDL = $_POST["CDL"];
if(isset($_POST["email"])) $email = $_POST["email"];
if(isset($_POST["password"])) $password = $_POST["password"];
if(isset($_POST["passConfirm"])) $passConfirm = $_POST["passConfirm"];
// if(isset($_POST["type"])) $type = $_POST["type"];
if(isset($_POST["firstName"])) $firstName = $_POST["firstName"];
if(isset($_POST["lastName"])) $lastName = $_POST["lastName"];
if(isset($_POST["city"])) $city = $_POST["city"];
if(isset($_POST["state"])) $state = $_POST["state"];
if (!empty($CDL) && !empty($email) && !empty($password) && !empty($firstName) && !empty($lastName) && !empty($city) && !empty($state))
{
session_start();
$_SESSION["CDL"] = $CDL;
$_SESSION["email"] = $email;
$_SESSION["password"] = $password;
$_SESSION["passConfirm"] = $passConfirm;
$_SESSION["type"] = $type;
$_SESSION["firstName"] = $firstName;
$_SESSION["lastName"] = $lastName;
$_SESSION["city"] = $city;
$_SESSION["state"] = $state;
header("Location: truckerCreationConfirm.php");
}
else
{
$err = true;
}
}
?>
<!doctype html>
<head>
<title>Create Client</title>
<style>
.errlabel {color:red;}
</style>
</head>
<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"
<label>CDL:
<input type="text" name="CDL" value="<?php if(!empty($CDL)) echo $CDL; ?>" />
</label>
<br />
<label>email:
<input type="text" name="email" value="<?php if(!empty($email)) 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>First Name:
<input type="text" name="firstName" value="<?php echo $firstName; ?>" />
<?php
if ($err && empty($firstName)) {
echo "<label class='errlabel'>Please enter a Location.</label>";
}
?>
</label>
<br />
<label>Last Name:
<input type="text" name="lastName" value="<?php echo $lastName; ?>" />
<?php
if ($err && empty($lastName)) {
echo "<label class='errlabel'>Please enter a Location.</label>";
}
?>
</label>
<br />
<label>City:
<input type="text" name="city" value="<?php echo $city; ?>" />
<?php
if ($err && empty($city)) {
echo "<label class='errlabel'>Please enter a valid userName.</label>";
}
?>
</label>
<br />
<label>State:
<input type="text" name="state" value="<?php echo $state; ?>" />
<?php
if ($err && empty($state)) {
echo "<label class='errlabel'>Please enter a valid code.</label>";
}
?>
</label>
<br />
<input type="submit" name="submit" value="Submit" />
</body>