Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a file called process.php that contains a PHP script . Here is what the s

ID: 3785821 • Letter: C

Question

Create a file called process.php that contains a PHP script. Here is what the script is supposed to do:

This script will receive a request from photodetailsform.html (this is the same file you used to complete lab1 ''figure 1'') form (using POST method NOT Get).

It will echo the passed information (the data from the input fields of the form) in a HTML table. The table should be part of a complete HTML page (see Figure2).

Figure 1

figure 2

the figure 2 is most important because i have done the figure one .. thank you

O Chapter 4 Zakaria C localhost/pa1/photodetails form.html Apps D2L Brights pace L... H Microsoft My Account JourneyEd.com: D e Other Bookmarks Photo Details Title My photo Description Taken by John. Continent Copyright? oAll rights reserved North America Creative Commons Country Canada Creative Commons Types Attribution City Noncommercial Montreal ONo Derivative Works O Share Alike I accept the software license Rate this photo: Date Taken: 01/18/2017 Color Collection: Time Taken: 05:05 AM Submit Clear Form

Explanation / Answer


I assume you have used something similar to this in your First HTML page.
The value of name attribute is very important.
We will be using that to get the value in PHP. (Eg. $_POST['name']).

<form action="action.php" method="post">
<p>Title <input type="text" name="title" /></p>
<p>Description <input type="text" name="description" /></p>
<p><input type="submit" /></p>
</form>


When the submit button is pressed by the user, the action.php file is called.
You can name your PHP file as anything. Just change the value of the action attribute.


----------------------------------------------------------------------

Now your action.php file must return a table.
Contents of action.php file
--------------------------------------------------------------------
<?php
// Since it was a post request we must use $_POST[''].
// You must replace the 'title' with what ever you have used in the form for name tag.
    $title = $_POST['title'];
    $description = $_POST['description'];
    $country = $_POST[''];
    $city = $_POST[''];
    $copyright = $_POST[''];
    $cct = $_POST[''];
    $license = $_POST[''];
    $color = $_POST[''];


    // We are going to create a table here.

    echo "<table border='1'><tr>";
    echo "<th>Title</th>";
    echo "<th>Description</th>";
    echo "<th>Country</th>";
    echo "<th>City</th>";
    echo "<th>Copyright</th>";
    echo "<th>CCT</th>";
    echo "<th>Software License</th>";
    echo "<th>Rating</th>";
    echo "<th>Color</th>";
    echo "<th>Date Taken</th>";
    echo "<th>Time Taken</th>";

    echo "</tr><tr>";
  
// Now we get the data from the form input.

    echo "<tr>"+$title+"</tr>";
    echo "<tr>"+$description+"</tr>";
    echo "<tr>"+$country+"</tr>";
    echo "<tr>"+$city+"</tr>";
    echo "<tr>"+$copyright+"</tr>";
    echo "<tr>"+$cct+"</tr>";
    echo "<tr>"+$license+"</tr>";
    echo "<tr>"+$rating+"</tr>";
    echo "<tr>"+$color+"</tr>";
  
    echo "</tr></table";
?>
----------------------------------------------------------------------

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote