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

Thompson Laboratory adopts Apache web server and PHP program for data input of i

ID: 2077616 • Letter: T

Question

Thompson Laboratory adopts Apache web server and PHP program for data input of its laboratories. Suppose you are a web master for Thompson Laboratory and you are required to provide solutions to the following problems: (a) How do you set the port number to 8088 in Apache web server? (b) You are given with the design of a web page in Figure 3 that displays a table which contains the information of the laboratories in Thompson Laboratory. The title of the table is "Laboratories", the top row with the field names "Room No.", "Type" and "No. of Seats" indicates the column headings and the width of the table's border is 2 pixels. When this web page appears, the background sound file called bit8.wav plays. This web page will forward a hidden field called location with the value "HHB" and another hidden field called quarter with the value "Spring20l6" by POST method to a PHP program called InsLab.php at the URL http://www.thompson.com.hk:8088 when the button with the label "Next" is pressed. Thorn peon Laboratory Laboratories Based on the above information, use HTML to design the web page in Figure 3. (c) An HTML form with the variable celcius is used for a user to enter a Celcius degree detected in a laboratory and pass the entered Celcius degree value by GET method to a PHP program in a web server installed in North America. In North America, the temperature unit is Fahrenheit. In this regard, that PHP program will convert the entered Celcius degree to Fahrenheit degree as follows: f = c times 9/5 + 32 where f is a degree in Fahrenheit and c is a degree in Celcius. Use an if...else structure to write this PHP program which displays the message "Too cold!" if the Fahrenheit degree value is below 32; otherwise, the PHP program displays the message "Not too cold!".

Explanation / Answer

a. to change the apache web server port number, open apache config file, httpd.conf
Change the listen address value to the new port number 8088
Restart the apache web service to see the change in action
b. <!DOCTYPE html>
<html>
<body>
<h3>Thompson Laboratary </h3>
<h5>Laboratories</h5>
<form action="http://www.thompson.com.hk:8088">
<table>
<tr>
<thRoom No.</th>
<th>Type</th>
<th>No. of Seats</th>
</tr>
<tr>
<td>FH318</td>
<td>Biomedical</td>
<td>30</td>
</tr>
<tr>
<td>LD6730</td>
<td>CHemical</td>
<td>10</td>
</tr>
<tr>
<td>XY39</td>
<td>IT</td>
<td>25</td>
</tr>
</table>
<input type="text" visibility="hidden" name="location" value="HHB">
<input type="text" visibility = "hidden" name="quarter" value="Spring2016">
<input type="submit" value="Next">
</form>

<p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.php".</p>

</body>
</html>

c. <?php
$c = GET['Celcius'];
$f = $c*9/5 + 32;
if($f<32){echo "Too cold!";}
else{echo "NOt too cold!";}

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