Steps to create forms and PHP

Download Report

Transcript Steps to create forms and PHP

PHP
Create Form
Create Form
Save as myform.html
Make sure method is “POST” and action is
“myform.php”
Nic Shulver, [email protected]
Chris Mayer, [email protected]
PHP
Create PHP code
Create myform.php
Use copy of test.php and check the action is
working i.e. it prints a message
Copy of test.php is downloadable from links
Nic Shulver, [email protected]
Chris Mayer, [email protected]
PHP
Create shortcut
Create internet shortcut to myform.html
http://web.fcet.staffs.ac.uk/ab123456/myform.html
But use your own student ID of course!
Create shortcut by double clicking on form,
changing the URL then dragging to folder
OR Copy a working shortcut and change the
filename in the properties
Nic Shulver, [email protected]
Chris Mayer, [email protected]
PHP
Complete PHP file
Add html and php step by step to myform.php
Save php file
Rerun form
Check new code is working
Errors may be on the line before the one
mentioned in an error message
Nic Shulver, [email protected]
Chris Mayer, [email protected]
PHP
Important!
PHP file must be in your t:\webpages area
It will not run on your H:drive space!
It will not run if you use T:\webpages\... as an
address as it is a FILE server path
It must be http://web.fcet.staffs.ac.uk/..., a
URL, a web server path
Check syntax carefully, especially semicolons
and quotes
Nic Shulver, [email protected]
Chris Mayer, [email protected]