Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


Path : /home/dent/public_html/_demos/
File Upload :
Current File : /home/dent/public_html/_demos/search2.php


<h1>Search films</h1>
<form action="results2.php">
    Title: <input type="text" name="title">
    <br>
    Genre:
    <select name="genre">
        <option value="all">Pick a genre</option>

<?php
$host = "webdev.iyaclasses.com";
$userid = "<youruserid>";
$userpw = "<yourpw>";
$db = "<database name>";

include '../pdloginvariables.php'; // you can ignore/skip this line

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

if($mysql->connect_errno) {
    echo "db connection error : " . $mysql->connect_error;
    exit();
}

$sql = "SELECT * FROM genres ORDER BY genre";

$results = $mysql -> query($sql);

if(!$results) {
    echo "SQL error: ". $mysql->error;
    exit();
}

while($currentrow = $results -> fetch_assoc()) {
    // loop code
    echo "<option value='" . $currentrow["genre_id"] . "'>" . $currentrow["genre"] . "</option>";
}

?>
    </select>
    <br>
    <input type="submit">
</form>