-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRegistration.php
86 lines (57 loc) · 1.23 KB
/
Registration.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
<?php
include 'User.php';
class Registration
{
private $user = null;
function __construct()
{
$this->user = new User();
}
public function Resgister(){
$this->user->createUser($this->namePassMail(), $this->addressSet());
}
public function namePassMail(){
if(isset($_GET['firstname']) && isset($_GET['lastname']) &&
isset($_GET['username']) && isset($_GET['password']) &&
isset($_GET['email'])){
$userArray = array(
$_GET['firstname'],
$_GET['lastname'],
$_GET['username'],
$_GET['password'],
$_GET['email']
);
return $userArray;
}else{
$userArray = array(
$_SERVER['argv'][1],
$_SERVER['argv'][2],
$_SERVER['argv'][3],
$_SERVER['argv'][4],
$_SERVER['argv'][5]
);
return $userArray;
}
}
public function addressSet(){
if (isset($_GET['street']) && isset($_GET['city']) &&
isset($_GET['state']) && isset($_GET['zip'])) {
$addressArray = array(
$_GET['street'],
$_GET['city'],
$_GET['state'],
$_GET['zip']
);
}else{
$addressArray = array(
$_SERVER['argv'][6],
$_SERVER['argv'][7],
$_SERVER['argv'][8],
$_SERVER['argv'][9]
);
}
}
}
$register = new Registration();
$register->Resgister();
?>