-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.php
121 lines (100 loc) · 2.54 KB
/
home.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
<?php
session_start();
include 'database.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/home_user.css"/>
<title>index</title>
</head>
<body>
<div class="fix main">
<div class="fix header">
<h1>ONLY SPORTS</h1>
</div>
<div class="fix navigation_bar">
<ul >
<?php
if($_COOKIE['id'])
{
if($_COOKIE['id']=='1234'){
?>
<li><a href="home.php">INDEX</a></li>
<li><a href="photo.php">PHOTOS</a></li>
<li><a href="register.php">REGISTRATION</a></li>
<li><a href="admin_page.php">ADMIN</a></li>
<li><a href="logout.php">LOGOUT</a></li>
<?php
} else{
?>
<li><a href="home.php">INDEX</a></li>
<li><a href="photo.php">PHOTOS</a></li>
<li><a href="register.php">REGISTRATION</a></li>
<li><a href="logout.php">LOGOUT</a></li>
<?php
}
}else
{
?>
<li><a href="home.php">INDEX</a></li>
<li><a href="photo.php">PHOTOS</a></li>
<li><a href="register.php">REGISTRATION</a></li>
<li><a href="login.php">LOGIN</a></li>
<?php
}
?>
</ul>
</div>
<div class="content">
<div class="fix content_middle">
<?php
$sql="SELECT * FROM status";
$res=mysql_query($sql);
$n=0;
while($row=mysql_fetch_array($res)){
$showing_id[$i]=$row['news_id'];
$n=$i++;
}
sort($showing_id);
$first=$showing_id[0];
$sql="SELECT * FROM status WHERE news_id='$first'";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res)){
?>
<div class="fix news1">
<img id="n1" src="<?php echo $row['image'];?>" alt="" />
<div class="news1_text">
<a href="read_more.php?p=<?php echo $first;?>" class="hyper_text"><h1 class="news1_h1"><?php echo $row['heading']; ?></h1></a>
<p class="fix news1_p"><?php echo $row['shortcut_status']; ?></p>
</div>
</div>
<hr />
<?php
}
for($i=1;$i<=$n;$i++){
$sql="SELECT * FROM status WHERE news_id='$showing_id[$i]'";
$res=mysql_query($sql);
while($row=mysql_fetch_array($res)){
?>
<div class="fix news1">
<img id="n1" src="<?php echo $row['image'] ?>" alt="text"/>
<div class="news1_text">
<a href="read_more.php?p=<?php echo $showing_id[$i]; ?>" class="hyper_text"><h1 class="news1_h1"><?php echo $row['heading']; ?></h1></a>
<p ><?php echo $row['shortcut_status']?></p>
<hr />
</div>
</div>
<?php
}
}
?>
</div>
</div>
</div>
<div class="fix footer">
<p class="fix footer_text1 ">PRINCE CSE 2K12</p>
</div>
</body>
</html>