Task 1 1 Create an initial HTML page titled movieshtml with

Task 1 1) Create an initial HTML page titled movies.html with 2 buttons. The first button will be labeled \"View Movies\", and the second button will be labeled \"Add Actor\". The first button should link to a file titled view movies The second button should link to a file titled add actor. html 2) Create the view movies file. This file should generate an html page that contains a table that lists all of the movies in the film table from the sakila database. You should list the following information about each movie: title, description, length, and rating. This page should have a button that returns you to the movies.html page Task 2 1) Create the add actor. html file. It should have a form with text boxes to input the following information about a new actor: first name, and last name. You will need two buttons on this page, save and cancel. The save button will need to insert the actor information into the actor table. (by linking to a file titled insertActor.php). Display a message stating whether the query was successful or not, and display a button to return to the movies.html page. The cancel button will simply need to return to the movies.html page and make no changes to the database

Solution

I try to give you max things you want you just need to create dbLink for your database and pass it to $dbLink variable you\'re all task will work:-

<!--movie.html-->

<html>

<head> </head>

<title>Movie </title>

<body>

<br><br>

<center>

<form name =\"viewmovie\" action = \"./view_movie.php\">

<input type = \"submit\" name=\"View Movie\" value =\"View Movie\">

</form>

<br><br>

<form name =\"addactor\" action = \"./add_actor.html\">

<input type = \"submit\" name=\"Add Actor\" value =\"Add Actor\">

</form>

</center>

</body>

</html>

<!--add_actor.html-->

<html>

<head> </head>

<title>Movie </title>

<body>

<br><br>

<center>

<form name =\"viewmovie\" action = \"./insertactor.php\">

<h3>Please Enter Actor Information </h3>

Actor First Name : <input type =\"text\" name =\"fname\" value =\"\"> <br><br>

Actor Last Name : <input type =\"text\" name =\"lname\" value =\"\">

<br><br><br>

<input type = \"submit\" name=\"Save\"> &nbsp;&nbsp;&nbsp;&nbsp;

<input type= \"button\" name =\"Cancel\" value =\"Cancel\" onClick=\"window.open(\'./movie.html\')\">

</form>

</center>

</body>

</html>

<!--insert_movie.php-->

<html>

<body>

<?php

$query = \"SELECT * FROM film order by title\";

$result = mysql_db_query($mysql_database,$query,$dblink);

if($result && mysql_num_rows($result)) {

$details=\"<table>\";

$details.= \"<thead><tr><th>Title</th><th>Description</th><th>Length</th><th>Rating</th></tr></thead><tbody>\";

while($row = mysql_fetch_array($result)) {

$details.=\"<tr>\";

$title = $row[\'title\'];

$description=$row[\'Description\'];

$length = $row[\'Length\'];

$rating = $row[\'Rating\'];   

$details.=\"<td>$title</td>\";

$details.=\"<td>$description</td>\";

$details.=\"<td>$length</td>\";

$details.=\"<td>$rating</td>\";

$details.= \"</tr>\";

}

$details.= \"</tbody></table>\";

}

echo \"$details\";

?>

<input type= \"button\" name =\"Back\" value =\"Back\" onClick=\"window.open(\'./movie.html\')\">

</body>

</html>

<!-- insert_actor.php-->

<?php

$fname = $_REQUEST[\'fname\'];

$lname = $_REQUEST[\'lname\'];

$query = \"INSERT INTO actor (fname,lname) VALUES (\'$fname\',\'$lname\');\";

$result= @mysqli_query($dbLink,$query);

if(@mysqli_affected_rows($dbLink) > 0){

$opstatus = 1;

$message =\"Actor Added successfully.\";

}

else{

$opstatus = 0;

$message =\"Insertion failed\";

}

?>

<html>

<body>

<h5>

<?$message;?>

</h5>

<?php

if($opstatus){

$query = \"SELECT * FROM actor order by title\";

$result = mysqli_query($dbLink,$query);

if($result && mysqli_num_rows($result)) {

$details=\"<table>\";

$details.= \"<thead><tr><th>Title</th><th>Description</th><th>Length</th><th>Rating</th></tr></thead><tbody>\";

while($row = mysqli_fetch_array($result)) {

$details.=\"<tr>\";

$title = $row[\'title\'];

$description=$row[\'Description\'];

$length = $row[\'Length\'];

$rating = $row[\'Rating\'];

$details.=\"<td>$title</td>\";

$details.=\"<td>$description</td>\";

$details.=\"<td>$length</td>\";

$details.=\"<td>$rating</td>\";

$details.= \"</tr>\";

}

$details.= \"</tbody></table>\";

}

echo \"$details\";

}

?>

<input type= \"button\" name =\"Back\" value =\"Back\" onClick=\"window.open(\'./movie.html\')\">

</body>

</html>

 Task 1 1) Create an initial HTML page titled movies.html with 2 buttons. The first button will be labeled \
 Task 1 1) Create an initial HTML page titled movies.html with 2 buttons. The first button will be labeled \
 Task 1 1) Create an initial HTML page titled movies.html with 2 buttons. The first button will be labeled \
 Task 1 1) Create an initial HTML page titled movies.html with 2 buttons. The first button will be labeled \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site