Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


Path : /home/dent/studentexams/kierasmi/
File Upload :
Current File : /home/dent/studentexams/kierasmi/results.php

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Acad276 Practical Exam: Results</title>
    <style>
        .container {
            width:  600px;
            margin: auto;
        }
        h1 {
            margin: auto;
            text-align: center;
            background-color:   #900;
            color:  #FC0;
            height: 60px;
            line-height: 60px;
        }
        .num-results {
            margin: 20px 10px;
        }
        table {
            margin: auto;
            margin-bottom: 20px;
            width:  80%;
            border-collapse: collapse;
        }
        th, td {
            border: 1px solid #900;
            border-collapse: collapse;
            padding:    10px;
            text-align: center;
        }
        img {
            width: 100px;
        }
        .nav-link{
            margin: 10px 0px;
            font-size: 14px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>Mobile Device Database: Search Results</h1>
    <div class="nav-link">
        <a href="search.php"><< Back to Search Page</a>
    </div>
    <div class="num-results">
        Your search returned
        <strong>3</strong>
        results.
    </div>

    <table>
        <tr>
            <th>Name</th>
            <th>Price</th>
            <th>Manufacturer</th>
            <th>System</th>
            <th>Type</th>
        </tr>

        <!--
        ****** SAMPLE OUTPUT ROW ******
        -->
        <tr>
            <td><a href="details.php?id=10">Pixel</a></td>
            <td>549.00</td>
            <td>Google</td>
            <td>Android</td>
            <td>Smartphone</td>
        </tr>
        <tr>
            <td><a href="details.php?id=11">Pixel 2</a></td>
            <td>649.00</td>
            <td>Google</td>
            <td>Android</td>
            <td>Smartphone</td>
        </tr>
        <tr>
            <td><a href="details.php?id=12">Pixelbook</a></td>
            <td>999.00</td>
            <td>Google</td>
            <td>Android</td>
            <td>Laptop</td>
        </tr>
    </table>
</div>
<?php
// COnnects to your database
$mysql_database= new mysqli (
    "webdev.iyaclasses.com",
"dent_guest",
 "Acad276_Ttrojan_Dev2Ex@m",
"dent_exam"
);

//Check if there are errors
if ($mysql_database->connect_error) {
        echo "Problem with the database so FIX IT" . $mysql_database->connect_error;
    exit ();
} else {
        echo "Looking good database";
}

//Telling the database to select all the fields from the device table meeting the requirements
$mysql_database= "SELECT * from devices WHERE " .
     "name='" . $_REQUEST["name"] . "'AND " .
    "title LIKE '%" . $_REQUEST["title"] . "%'";
     "manufacture='" . $_REQUEST["name"] . "'AND " .
    "title LIKE '%" . $_REQUEST["title"] . "%'";
$results = $mysql_database->query($sql);

// if they are not your results an error will be thrown out as a warning
if(!$results) {
    echo "SQL ERROR:" .$mysql_database->error;
    echo "SQL STATEMENT: " . $sql;
    exit();
} else {
        echo "AWESOME RESULTS for " .$sql . "<hr>";
}

// you are printing out the results
print_r($results);
echo "I got back " .$results->num_rows . " results";

while($currentrow = $results->fetch_assoc()) {
    echo "<strong style='color:purple';>"  .$currentrow["title"];
    echo "</strong> (". $currentrow["genre"];
    echo ")<br>";
}
?>
</body>
</html>