Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


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

<?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();
}

?>

<h1>Add Movie</h1>

<form action="addmovie.php">
    Movie Title:
    <input type="text" name="title">
    <br>
    Genre:
    <select name="genre">

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

        $results = $mysql -> query($sql);
        if(!$results){
            echo "SQL ERROR! " . $mysql -> error;
            echo "<hr>" . $sql . "<hr>";
        }

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

        }
        ?>
    </select>
    <br>

    Rating:
    <select name="rating">
        <?php
        $sql = "SELECT * from ratings";

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

        while($currentrow=$results->fetch_assoc()) {
            echo "<option value='"  . $currentrow["rating_id"] .  "'>" . $currentrow["rating"] . "</option>";

        }

        ?>

    </select>
    <br>

    <input type="submit">

</form>