-
Notifications
You must be signed in to change notification settings - Fork 0
/
getnews.php
50 lines (46 loc) · 1.46 KB
/
getnews.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
<?php
session_start();
$token=$_POST['token'];
if(isset($_SERVER['HTTP_REFERER']))
{
$page=$_SESSION['newspage'];
$start_from=($page-1)*3;
$_SESSION['newspage']++;
require_once("dbconnection.php");
$sql="select * from TBL_NAME where (Category='TechNews') OR (Category='CurrentAffairs') LIMIT $start_from,3";
$result=mysqli_query($con,$sql);
$count=mysqli_num_rows($result);
if($count>0)
{
$_SESSION['newspage']++;
while($row=mysqli_fetch_array($result,MYSQL_ASSOC))
{
$title=$row['Title'];
$date=$row['Date'];
$link=$row['Link'];
$image=$row['Image'];
$author=$row['Author'];
$id=$row['LId'];
$Id=$row['Id'];
echo("<div class='card medium hoverable news'>
<div class='card-image' style='background:url($image); background-size:cover; background-position:center center;'>
<a style='background: rgb(0, 0, 0); background: rgba(0, 0, 0, 0.7);height:100%;' class='card-title'>$title</a>
</div>
<div class='card-content'>
<div style='background:url(pics/$author.jpg);background-size:cover; background-position: center center;' class='team1'></div>
<a id='author'>$author</a>
<a id='date'>$date</a>
</div>
<div style='text-align:center;' class='card-action'>
<a style='color:#E65100;' href='$link'>Read Now</a>
</div>
</div>
");
}
}
}
else
{
header("location:http://thefrontier.in/default.php");
}
?>