Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("connect.php");
- !isset($_GET["page"]) ? $page = 1 : $page = $_GET["page"];
- $query_car = "SELECT * FROM car";
- $table_car = mysqli_query($link,$query_car);
- for ($i=0; $i < mysqli_num_rows($table_car) ; $i++) {
- $row = mysqli_fetch_array($table_car);
- $id[$i] = $row["id"];
- $name[$i] = $row["name"];
- }
- $query_car_foto = "SELECT * FROM car_foto WHERE id_car='$page'";
- $table_car_foto = mysqli_query($link,$query_car_foto);
- for ($i=0; $i < mysqli_num_rows($table_car_foto) ; $i++) {
- $row = mysqli_fetch_array($table_car_foto);
- $img[$i] = $row["foto"];
- }
- ?>
- <!DOCTYPE html>
- <html lang="ru">
- <head>
- <link rel="stylesheet" type="text/css" href="z1.css">
- <meta charset="UTF-8">
- <title>Auto</title>
- </head>
- <body>
- <table width="100%">
- <tr>
- <td class="logo">
- <p>Лучшие авто мира</p>
- </td>
- <td rowspan="2">
- <?php for ($i=0; $i < count($img) ; $i++): ?>
- <p><img src="<?= $img[$i]?>"></p>
- <?php endfor ?>
- </td>
- </tr>
- <tr>
- <td class="menu" rowspan="2">
- <?php for ($i=0; $i < count($name) ; $i++): ?>
- <a href="?page=<?=$id[$i]?>" <?= $i == $page - 1 ? "style=color:white" : "" ?>><?=$name[$i]?></a>
- <?php endfor ?>
- </td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement