-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewnews.php
62 lines (60 loc) · 1.64 KB
/
viewnews.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
<?php
include("header.php");
include("connection.php");
if($_POST["button"])
{
$result = mysqli_query($con,"SELECT * FROM updates WHERE title LIKE '%$_POST[newstitle]%'");
}
else
{
$result = mysqli_query($con,"SELECT * FROM updates");
}
?>
<div id="main">
<div id="content" class="left">
<div class="highlight">
<h3>View News</h3>
<form id="form1" name="form1" method="post" action="">
<p><a href="update.php"><strong>Add News</strong></a>
<input type="text" name="newstitle" id="newstitle" />
<input type="submit" name="button" id="button" value=" Search " />
</p>
</form>
<table width="576" border="1">
<tr>
<th width="228" height="23" scope="col">News Title</th>
<th width="160" scope="col">Date</th>
<th width="166" scope="col">Time</th>
</tr>
<?php
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td> <a href='viewupdateprof.php?proid=$row[upda_id]'> $row[title]</td>";
echo "<td> $row[date]</td>";
echo "<td> $row[time]</td>";
echo "</tr>";
}
?>
</table>
<p> </p>
</div>
<div class="projects">
<div class="item"></div>
<div class="item">
<div class="cl"> </div>
</div>
</div>
</div>
<?php
include("sidebar.php");
?>
<div class="cl"> </div>
</div>
<div class="shadow-l"></div>
<div class="shadow-r"></div>
<div class="shadow-b"></div>
</div>
<?php
include("footer.php");
?>