-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKayitol.php
202 lines (148 loc) · 8.1 KB
/
Kayitol.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
session_start();
if($_SESSION["Meslek"]!="admin"){
header('Location: http://159.89.103.125/TcKimlikSorgu.php');
}
include 'Baglan.php';
include 'Information.php';
$baglanti=(new Baglan())->basla();
$baglanti->select_db("Admin");
$information=new Information();
$arizalar=$information->arizalar;
$kullaniciAdi="";$sifre="";$isim="";$soyisim="";$email="";$eror="";
if(isset($_POST['submit'])){
//İnputlardaki veriler alınıyor.
$sifre=$_POST['password'];
$tekrarSifre=$_POST['repassword'];
$kullaniciAdi=$_POST['username'];
$isim=$_POST['name'];
$soyisim=$_POST['lastname'];
$email=$_POST['email'];
$meslek=$arizalar[str_split($_POST['ariza'])[1]];
$telefon=$_POST['tel'];
if(strpos($sifre,' ')!==false){//Şifrede boşluk varise
$eror="*Şifrede Boşluk Olamaz";
}else{//Yok ise
//şifrenin m5 i alınıyor
$sifre=md5($sifre);
$tekrarSifre=md5($tekrarSifre);
//Şifre veritabanına aranıyor
$result=$baglanti->query("SELECT kullaniciAdi,email FROM Uyeler WHERE kullaniciAdi='$kullaniciAdi' OR email='$email'");
$value = mysqli_fetch_object($result);
if($value->kullaniciAdi!="" || $value->email!=""){//Eger kullanıcı adı veya epostadan varsa
$eror="*Bu Kullanıcı Adı Veya Email Adresi Zaten Kullanılmakta";
}
else if($sifre==$tekrarSifre){//Yoksa şifre ile tekrar şifre kontrol ediliyor
//Uyeler tablosuna yeni üye ekleniyor.
$sql = "INSERT INTO Uyeler(kullaniciAdi, sifre, isim, soyisim, email, meslek, telefon, bildiri) VALUES ('$kullaniciAdi','$sifre','$isim','$soyisim','$email','$meslek','$telefon',0)";
if($baglanti->query($sql)){//Başarılı ise
//Uye ekleme sekmesi kaoatılıyor
echo "<script>window.close();</script>";
mysqli_free_result($result);
mysqli_close($baglanti);
}else{
$eror="*Üye Olamadınız, Lütfen Formu Kontrol Ediniz";
}
}else{
$eror="*Şifre uyuşmuyor";
}
}
}
?>
<html lang="tr" >
<head>
<link rel="stylesheet" href="css/Css.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<script type="module" src="js/index.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=1024">
<title>Giriş Yap - Kayıt Ol</title>
</head>
<body>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<div class="ekran">
<div class="ustkisim"></div>
<div class="altkisim">
<form method="post" action="Kayitol.php" >
<div class="formCard">
<div class="cubuk"></div>
<div class="formCard" id="formCard">
<div class="forum">
<div >
<h4 class="baslik_color" ><b>ÜYE OL</b></h4>
</div>
<!-- -->
<div class="row">
<div class="input-field col s12">
<input id="username" name="username" type="text" minlength="3" maxlength="30" class="validate" value="<?php echo $kullaniciAdi;?>" required >
<label for="username">Kullanıcı Adı</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="password" name="password" type="password" minlength="5" maxlength="30" class="validate" value="" required >
<label for="username">Şifre</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="repassword" name="repassword" type="password" minlength="5" maxlength="30" class="validate" required >
<label for="repassword">Şifre Tekrar</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="name" name="name" type="text" minlength="2" maxlength="30" class="validate" value="<?php echo $isim;?>" required >
<label for="name">İsim</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="lastname" name="lastname" type="text" minlength="2" maxlength="30" class="validate" value="<?php echo $soyisim;?>" required >
<label for="lastname">Soy İsim</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="email" name="email" type="email" minlength="2" maxlength="40" class="validate" value="<?php echo $email;?>" required >
<label for="email">Email</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="tel" name="tel" type="tel" pattern="^5\d{2}\d{3}\d{4}$" maxlength="10" class="validate" value="<?php echo $telefon;?>" required >
<label for="tel">Cep Telefonu (5XXXXXXXXX)</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<select id="ariza" name="ariza" class="input-field col s12" required >
<option value="" disabled selected>Hangi Alanda Üye Olacaksınız</option>
<?php
for ($x = 0; $x < sizeof($arizalar); $x++) {
echo "<option value='.$x+1.' >$arizalar[$x]</option> ";
}
?>
</select>
</div>
</div>
<div class="row" >
<div class="input-field col m6 s12" >
<button type="submit" name="submit" class="btn waves-light"><i class="material-icons right">send</i>Kayıt Ol</button>
<p><font id="eror" color="#D50000" size="2px" face="elephant"><?php echo $eror;?></font></p>
</div>
</div>
<!-- -->
</div>
</div>
</div>
</form>
</div>
</div>
</body>
</html>