-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
338 lines (312 loc) · 12.6 KB
/
index.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<?php
error_reporting(0);
session_start();
$conn = mysql_connect('localhost','root','1995');
$db = mysql_select_db('art_gallary');
if(isset($_POST['submit'])){
$firstname = stripcslashes($_POST['firstname']);
$lastname = stripcslashes($_POST['lastname']);
$username = stripcslashes($_POST['username']);
$password = stripcslashes($_POST['password']);
$password2 = stripcslashes($_POST['password2']);
$country = stripcslashes($_POST['country']);
$city = stripcslashes($_POST['city']);
$phone_number = stripcslashes($_POST['number']);
$email = stripcslashes($_POST['email']);
if(!empty($firstname) && !empty($lastname) && !empty($username) && !empty($password) && !empty($country) && !empty($city) && !empty($phone_number) && !empty($email)){
if($password == $password2){
$firstname = mysql_real_escape_string($firstname);
$lastname = mysql_real_escape_string($lastname);
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$password = md5($password);
$country = mysql_real_escape_string($country);
$city = mysql_real_escape_string($city);
$phone_number = mysql_real_escape_string($phone_number);
$email = mysql_real_escape_string($email);
$in = "INSERT INTO art_gallary_table (firstname,secondname,username,password,country,city,phone_number,email)
VALUES ('$firstname','$lastname','$username','$password','$country','$city','$phone_number','$email')";
$insert = mysql_query($in,$conn);
if($insert == true){
echo '<script type="text/javascript" document="javascript" >alert("your account is created log in to proceed");</script>';
}
}else{
echo '
<script type="text/javascript" document="javascript">
alert("the passwords does not match");
</script>
';
}
}else{
echo '
<script type="text/javascript" document="javascript">
alert("please input all the required field");
</script>
';
}
}
/*
*/
function login(){
$conn = mysql_connect('localhost','root','1995');
$db = mysql_select_db('art_gallary');
if(isset($_POST['submitin'])){
$user = mysql_real_escape_string($_POST['user']);
$pass = mysql_real_escape_string($_POST['pass']);
$pass = md5($pass);
$select = "SELECT * FROM art_gallary_table WHERE (username = '$user' OR email = '$user') AND password = '$pass'";
$query = mysql_query($select,$conn) or die('something went wrong please try again');
$row = mysql_fetch_array($query,MYSQL_ASSOC);
if(($row['username'] === $user OR $row['email'] === $user) AND $row['password'] == $pass ){
if($_SESSION['user'] = $row['user_id']){
echo '<script type="text/javascript" document="javascript">
open("createthanks.php");
</script>
';
}
}else{
echo '<input type="button" name="submit" class="btn btn-link" value="forgotten password" style="color:black;"><br><br>';
}
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="media.css">
<link type="image.jpg" href="uploads/art2.jpg" rel="icon">
<link href="art.jpg" rel="icon" type="image/png">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<!---fort owsome link-->
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<!--<link rel="stylesheet" href="main.css" media="screen" title="no title" charset="utf-8">-->
<script src="bootstrap/js/bootstrap.min.js"></script>
<script src="bootstrap/js/jquery.js"></script>
<script src="jqscript.js"></script>
<title>Art Gallary And Auctioning</title>
<style>
@keyframes spin{
100%{
transform:rotate(360deg);
}
}
@keyframes spin{
100%{
-webkit-transform:rotate(360deg);
transform:rotate(360deg);
}
}
@keyframes spin{
100%{
-moz-transform:rotate(360deg);
transform:rotate(360deg);
}
}
@keyframes spin{
100%{
-o-transform:rotate(360deg);
transform:rotate(360deg);
}
}
#loading{
width:55px;
height:55px;
border-radius:100%;
position:fixed;
border:4px solid #CCC;
border-top-color:gray;
border-right-color:black;
border-right-color:transparent;
position:fixed;
z-index:1;
left:50%;
top:50%;
animation:spin 0.7s infinite linear;
-moz-animation:spin 0.7s infinite linear;
-o-animation:spin 0.7s infinite linear;
-webkit-animation:spin 0.7s infinite linear;
}
input:hover{
border:2px solid lightgreen;
}
input:focus{
border:2px solid silver;
background:black;
color:white;
font-family:calibrilight;
}
</style>
<script>
function load(){
document.getElementById('loading').style.display="none";
}
</script>
</head>
<body onload="return load()">
<div id="loading"></div>
<div class="container-fluid"style="margin:20px auto;background:silver;padding-top:20px;">
<div class="row" style="background:silver;">
<div class="col-sm-2">
</div>
<div class="col-sm-8" style="background:white;" >
<header id="header">
<a href="art.php" style="color:white;text-decoration:none;" class="h"><h3 style="color:black;font-family:forte;float:left;" >ART GALLARY AND AUCTIONING</h3></a>
<i class="fa fa-spinner fa-spin"></i>
<button class="btn btn-default" style="background:black;float:right;color:white" id="CREATE-ACCOUNT">CREATE ACCOUNT</button>
<a href="art.php" style="color:black;float:right;margin-top:35px;margin-right:25px;"><span class="glyphicon glyphicon-refresh" ></span></a>
</header>
<div class="row" style="margin-top:10px;">
<!--first column-->
<div class="col-sm-1">
</div>
<!--second col-->
<div class="col-sm-8">
<h2 style="font-family:chiller;color:lightblack"id="h-w"><strong>TRENDING #ARTS OF THE DAY.<span class="glyphicon glyphicon-pencil">.....</span></strong></h2>
<div class="row">
<div class="col-sm-6">
<div class="posts">
<img src="uploads/art.jpg" title="<?php echo 'art by nevil rose';?>" class="img-responsive" width="200px" height="200px">
<br>
<h4 style="text-decoration:underline;color:black">portrait details</h4>
<ul class="details">
<li>price : $20 OR 200 Ksh.</li>
<li>uploaded date : 20/3/2016.</li>
<li style="color:red">Auctioned price = $100</li>
<li><button class="btn btn-success" title="delete portrait" id="call"><span class="glyphicon glyphicon-earphone"> view number</span></button></li>
</ul>
<button class="btn btn-primary" title="like portrait"><span class="glyphicon glyphicon-thumbs-up"></span></button>
<button class="btn btn-warning" title="unlike portrait"><span class="glyphicon glyphicon-thumbs-down"></span></button>
<button class="btn btn-info" title="buy"><span >buy </span></button>
<br><br>
</div>
</div>
<div id="col-sm-6">
<!-- seecond pic-->
<div class="posts">
<img src="uploads/art2.jpg" title="<?php echo 'art by nevil rose';?>" class="img-responsive" width="200px" height="200px">
<br>
<h4 style="text-decoration:underline;color:black">portrait details</h4>
<ul class="details">
<li>price : $20 OR 200 Ksh.</li>
<li>uploaded date : 20/3/2016.</li>
<li style="color:red">Auctioned price = $100</li>
<li><button class="btn btn-success" id="call2" title="delete portrait"><span class="glyphicon glyphicon-earphone"> view number</span></button></li>
</ul>
<button class="btn btn-primary" title="like portrait"><span class="glyphicon glyphicon-thumbs-up"></span></button>
<button class="btn btn-warning" title="unlike portrait"><span class="glyphicon glyphicon-thumbs-down"></span></button>
<button class="btn btn-info" title="buy"><span >buy </span></button>
<br><br>
</div>
</div>
</div>
</div>
<!--third col-->
<div class="col-sm-3" style="margin-top:50px;">
<!--login form-->
<form role="form" action="index.php" method="POST">
<div class="form-group has-user has-feedback">
<input type="text" class="form-control" placeholder="USERNAME" name="user">
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-lock has-feedback">
<input type="password" class="form-control" placeholder="PASSWORD" name="pass">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<input type="submit" class="btn btn-info" name="submitin" value="LOGIN" style="font-family:chiller;font-style:bold;"><br>
<?php login();?>
</form>
<!--form ended-->
</div>
</div>
</div>
<div class="contact">
<p>Call Me On Or Whatsapp Me On : </p>
<h4><span class="glyphicon glyphicon-earphone"> 254 700145432</span></h4>
<p>Also mail please for more info:</p>
<button class="btn btn-success"><a href="mailto:0700145432" style="color:white;text-decoration:none;">CALL</a></button >
<button class="btn btn-info"><span class="glyphicon glyphicon-envelope"> </span><a href="mailto:[email protected]" style="color:white;text-decoration:none;">MAIL</a></button >
<button class="btn btn-danger" id="cancel">CANCEL</button >
</div>
<div id="createaccount">
<button class="btn btn-default" id="crete">CREATE ACCOUNT</button>
<span id="close_remove" class="glyphicon glyphicon-remove" style="cursor:pointer;float:right;color:red;font-size:1.5em;"></span>
<hr style="border-color;black;">
<!----CREATE ACCOUNT FORM BELOW---->
<form class="form2" action="<?php $_PHP_SELF; ?>" method="POST" style="margin:10px 0px 0px 0px;" id="classform" >
<div class="form-group">
<input type="text" class="form-control" name="firstname" placeholder="FIRSTNAME">
</div>
<div class="form-group">
<input type="text" class="form-control" name="lastname" placeholder="LASTNAME">
</div>
<div class="form-group">
<input type="text" class="form-control" name="username" placeholder="USERNAME">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="PASSWORD">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password2" placeholder="CONFIRMPASSWORD">
</div>
<div class="form-group">
<input type="text" class="form-control" name="country" placeholder="COUNTRY">
</div>
<div class="form-group">
<input type="text" class="form-control" name="city" placeholder="CITY">
</div>
<div class="form-group">
<input type="number" class="form-control" name="number" placeholder="PHONE NUMBER">
</div>
<div class="form-group">
<input type="email" class="form-control" name="email" placeholder="EMAIL">
</div>
<input type="submit" class="btn btn-info" name="submit" value="CREATE ACCOUNT" style="font-family:chiller;font-style:bold;">
</form>
</div>
<div class="col-sm-2">
</div>
</div>
<footer>
<div class="row" ">
<div class="col-sm-2">
</div>
<div class="col-sm-8">
<div class="row" style="background:white;">
<hr>
<div class="col-sm-2">
</div>
<div class="col-sm-8">
<div class="col-sm-6">
<h5>Follow us on </h5>
<img src="icons/email.png" width="50" height="50" title="GMAIL" class="img">
<img src="icons/fb.png" width="50" height="50" title="FACEBOOK" class="img">
<img src="icons/twitter2.png" width="50" height="50" title="TWITTER" class="img">
<img src="icons/instagram.png" width="50" height="50" title="INSTAGRAMN" class="img">
</div>
<div class="col-sm-6">
<h5><a href="#" style="color:blue;">About arts page</a></h5>
<h5><a href="#" style="color:blue;">contact us </a></h5>
<h5><a href="#" style="color:blue;" >faq</a></h5>
<h5"><a href="#" style="color:blue;">art's page news</h5></a>
</div>
</div>
<div class="col-sm-2">
</div>
</div>
</div>
<div class="col-sm-2">
</div>
</div>
</footer>
</div>
</body>
</html>