• Homework
  • Thirds
  • Upper Thirds
  • Fourth
  • Divisions
    • ICT
    • Computer Science
  • Fifth
  • Lower Sixth
  • Upper Sixth
    • Upper Sixth Theory
  • Blog
  • Careers
  • Unity
  • Networking

Server Side Scripting

Key points to understand:  (pages 199-212 of the A2 Textbook)
  • CGI stands for 'Common Gateway Interface'  and sits between the Web server and Web Server Extensions
  • The 'request - response' system
  • How forms work on a web page, with name-value pairs identifying the data.
  • The distinction between the 'GET' and 'POST' mechanisms
Server side scripts from grahamwell

Example examination questions (.doc)

Examples

Note:  To make these examples work from a local computer, you'll need to give the full web address of the scripts:
http:\\www.starteractivity.com\test\scriptname.php
Client Site GET - HTML Code
<html>
<head>
<title>Server Get Test</title>
</head>
<body>
<h4>Merchant Taylor Sixth Form - Art Supplies<h4>
<h5>Using GET</h5>
<form action="serverget.php" method="get">
<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
</select>
Quantity:<input name="quantity" "text" />
<input type ="submit" />
</form>
</body>
</html>
Server Side GET - HTML and PHP
<html><body>
<?php
$quantity = $_GET['quantity'];
$item = $_GET['item'];
echo "You used GET to order ".$quantity." ".$item."<br/>";
echo "Look at the URL!";
echo "Thank you";
?>
</body>
<html>



Client Side POST - HTML Code
<html>
<head>
</head>
<body>
<h4>Merchant Taylor Art Supplies<h4>
<h5>Using POST</h5>
<form action="serverpost.php" method="post">
<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
</select>
Quantity:<input name="quantity" "text" />
<input type ="submit" />
</form>
</body>
</html>
Server Side POST - HTML and CSS
<html><body>
<?php
$quantity = $_POST['quantity'];
$item = $_POST['item'];
echo "You ordered ".$quantity." ".$item."<br/>";
echo "Thank you";
?>
</body><html>
Powered by Create your own unique website with customizable templates.