* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
Path : /proc/self/cwd/ |
|
Current File : //proc/self/cwd/edit_drilldown.php |
<?php
if(empty($_REQUEST['id'])) {
echo "Please go through <a href='search_drilldown.php'>search</a> page.";
exit();
}
$host = "webdev.iyaclasses.com";
$userid = "[youruserid]";
$userpw = "[yourpw]";
$db = "[database name]";
include '../pdloginvariables.php';
$mysql = new mysqli(
$host,
$userid,
$userpw,
$db
);
if($mysql->connect_errno) {
echo "db connection error : " . $mysql->connect_error;
exit();
}
?>
<html>
<head>
<title>Edit movie</title>
</head>
<body>
<?php
$sql = "SELECT * from movieView2 WHERE dvd_title_id = " .
$_REQUEST['id'];
$results = $mysql->query($sql);
if(!$results) {
echo "<hr>Your SQL:<br> " . $sql . "<br><br>";
echo "SQL Error: " . $mysql->error . "<hr>";
exit();
}
?>
<br>Edit Movie details<hr>;
<?php
$recorddetails = $results->fetch_assoc();
print_r($recorddetails);
?>
<form action="update.php">
<input type="hidden" name="id" value="<?php echo $recorddetails["dvd_title_id"] ;?>">
<br><strong>Title:</strong>
<input type="text" name="title" value="<?php echo $recorddetails["title"] ?>">
<br>Genre:
<select name="genre">
<option value="<?php echo $recorddetails["genre_id"]; ?>">
<?php echo $recorddetails["genre"]; ?>
</option>
</select>
<br>Rating:
<select name="rating">
<option value="<?php echo $recorddetails["rating_id"]; ?>">
<?php echo $recorddetails["rating"]; ?>
</option>
<?php
// load and output all ratings
$sql = "SELECT * from ratings";
$ratingresults = $mysql->query($sql);
while($currentrow = $ratingresults->fetch_assoc()) {
echo "<option value='" . $currentrow["rating_id"] . "'>" .
$currentrow["rating"]. "</option>";
}
?>
</select>
<br><input type="submit" value="Submit Movie Changes">
</form>
</body>
</html>