-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCategory.php
More file actions
71 lines (64 loc) · 1.74 KB
/
Category.php
File metadata and controls
71 lines (64 loc) · 1.74 KB
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
<head>
<meta charset="utf-8">
<title>Feedback
</title>
<link rel="stylesheet" href="css/main.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="css/main_page.css" type="text/css" charset="utf-8">
<meta name="description" content="NEWS">
<meta name="keywords" content="NEWS">
<meta name="viewport" content="width=device-width, inital-scale=1">
<link href="img/sv.png" rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" href="css/font-awesome.min.css">
</head>
<body>
<?php include 'login.php' ?>
<?php session_start();
?>
<div id="wrapper">
<div id="content">
<?php include 'header.php';?>
</div>
<div >
<?php
$idc = $_GET['idcat'];
$servername ='localhost';
$username='root';
$password='';
$dbname='base1';
$con= new mysqli($servername,$username,$password, $dbname);
if ($con->connect_error){
die('error');
}
$sql="SELECT * FROM categories ";
$result=$con->query($sql);
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
if($row['id']==$idc){
?>
<img class="cImg" src="<?php echo $row['url_img']; ?>" />
<div ><?php echo $row['title']; ?></div>
<?php
}
}
}
$sql="SELECT * FROM news ";
$result=$con->query($sql);
if($result->num_rows>0){
while($row=$result->fetch_assoc()){
if($row['id_category']==$idc){
?><a href="New.php?idn=<?php echo $row['id']?>">
<img class="cImg" src="<?php echo $row['url_image']; ?>" />
<p ><?php echo $row['title']; ?></p></a>
<?php
}
}}
?>
</div>
</div>
<?php include 'scr.php';?>
</body>
<?php if (isset($_SESSION['login'])){ ?>
<?php } else{ ?>
<script src="login.js"></script>
<?php } ?>
</html>