Here is an introduction to the php programming language. Topics include:
Statements end with semicolon
Single line and multi-line comments
How to name variables
Data types: boolean, numeric (integer and floating point), string
Single quoted strings and double-quoted strings
Using $_GET["name"] to access values from submitting form
Note: I strongly suggest you view all our videos in full screen mode: click the icon
in the lower right corner of the video area (it shows four arrows pointing
to the corners of the screen). When you are done, the Esc ("escape") key
returns you to regular mode.
This exercise is primarily focused on getting a simple php CGI coded and running correctly.
In your AdvancedWebFiles/cgis directory you will find a file "phpStarter.txt" which
you may find useful. Our goal here is to create a php CGI that will respond to the
user request by thanking them by name for their suggestion and showing the suggestion
in order to make it clear you got it.
Open phpStarter.txt and save it as Feedback.php in your AdvancedWebFiles/cgis directory
In your Feedback.php code, replace the text wherever you see "==" to reflect the current exercise
Add 'echo' statements to build a page that thanks the user for their suggestion
Retrieve all five values from the form input elements into php variables:
$who - value of 'name' input element
$email - value of 'email' input element
$suggestion - value of 'suggestion' input element
$isMember - value of 'member' checkbox element
$resident - value of 'resident' radio button element
echo a title element: "A suggestion"
echo an h1 element: "Thank you for your suggestion"
echo a p element: "Thank you, $who, for your suggestion of:<br><br>"
echo a few non-breaking spaces followed by $suggestion in bold
echo <br><br> followed by a link back to SuggestionBox.shtml followed by </p>
Save the updated Feedback.php and upload it to AdvancedWebFiles/cgis
Test your CGI works by getting to SuggestionBox.shtml and trying various values.
A cumulative summary of the contents of this course so far:
For a combined cumulative summary of both Web courses so far,
if you would like additional information.
We would love to see your comments and
recommendations for our site.
of where you are on the site, but we do not
leave cookies on your site; we do not track
your visits; we do not disseminate any
information about you because we do not
gather any information about you.