Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


Path : /home/dent/public_html/acad274/
File Upload :
Current File : /home/dent/public_html/acad274/studenttest.php

<?php
$host = "webdev.iyaserver.com";
$userid = "msafrono";
$userpw = "AcadDev_Safronov-Yamamoto_9919134910";
$db = "msafrono_movies";

$mysql = new mysqli($host, $userid, $userpw, $db);

if ($mysql->connect_errno) {
    die("DB Connection Error: " . $mysql->connect_error);
}

$sql = "SELECT title, genre, rating FROM view1 WHERE rating='R' AND genre='Animation' AND title LIKE 'A%' ORDER BY title";
$results = $mysql->query($sql);

if (!$results) {
    die("SQL Error: " . $mysql->error . " running query: " . $sql);
}

if ($results->num_rows == 0) {
    echo "<h3 style='text-align:center; color:red;'>No R-Rated Animation movies starting with 'A' found.</h3>";
    exit();
}

$results->data_seek(0);
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <title>R-Rated Animation Movies that Start with A</title>
    <style>
        table {
            width: 900px;
            background-color: coral;
            margin: auto;
            border-collapse: collapse;
        }
        th, td {
            width: 200px;
            padding: 10px;
            text-align: center;
            border: 1px solid black;
        }
        th {
            background-color: pink;
            color: white;
        }
        h1 {
            font-size: 32pt;
            color: rgb(0, 0, 0);
            text-align: center;
        }
        h3 {
            font-size: 15pt;
            color: rgb(0, 0, 0);
            text-align: center;
        }
    </style>
</head>
<body>
<h1>Animation Movies</h1>
<h3>R-Rated Animation Movies that Start with "A"</h3>

<?php if ($results->num_rows > 0) { ?>
    <table>
        <thead>
        <tr>
            <th>Title</th>
            <th>Genre</th>
            <th>Rating</th>
        </tr>
        </thead>
        <tbody>
        <?php while ($currentrow = $results->fetch_assoc()) { ?>
            <tr>
                <td><strong><?= htmlspecialchars($currentrow["title"]) ?></strong></td>
                <td><?= htmlspecialchars($currentrow["genre"]) ?></td>
                <td><em><?= htmlspecialchars($currentrow["rating"]) ?></em></td>
            </tr>
        <?php } ?>
        </tbody>
    </table>
<?php } ?>
</body>
</html>