-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
56 lines (44 loc) · 1.43 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
<?php
$conn = mysqli_connect("localhost","root","","facemash");
if(!$conn){
echo 'Not connection DB';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Facemash</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="header">
<h1>FACEMASH</h1>
</div>
<div class="main_wrapper">
<p>
<strong>We are let in for our looks? No. Will we be judged on them? Yes.</strong>
</p>
<h3>Who's Hotter? Click to Choose.</h3>
<?php
do{
$query1="SELECT * from photos ORDER BY rand() ";
$sql1=mysqli_query($conn, $query1);
$row1=mysqli_fetch_array($sql1);
$query2="SELECT * from photos ORDER BY rand() ";
$sql2=mysqli_query($conn, $query2);
$row2=mysqli_fetch_array($sql2);
}while($row2['id'] == $row1['id']) ;
?>
<div id="photoRandom">
<a href="vote.php?id1=<?php echo $row1['id'] ?>&id2=<?php echo $row2['id'] ?>&photo=first"><img src="images/<?php echo $row1['photo'] ?>" /></a>
<p id="or">OR</p>
<a href="vote.php?id2=<?php echo $row2['id'] ?>&id1=<?php echo $row1['id'] ?>&photo=second"><img src="images/<?php echo $row2['photo'] ?>" /></a>
</div>
</div>
<br><br>
<center>
<a href="ranking.php" class="rank" style="text-decoration:none;color:#000;font-size:25px;"><strong>Rankings</strong></a>
</center>
</body>
</htmL>