Skip to main content
MPCC
Back to Website
Enter your search query
You are currently using guest access (
Log in
)
PHP/MySQL Course
Home
Courses
Miscellaneous
MoodleShare Archive
MoodleShare Technology
PHP/MySQL
Topic 3
PHP Forms ($$$)
PHP Forms ($$$)
Read about simple form procession from page 201 to 205 top two lines.
Notes:
The $_POST array global variable is automatically filled in from the from fields and the submit button.
All the data in the $_POST array are strings
This part of the chapter covers the two part form. One part is the form, and the processing of the form is in a separate php file
The php file that processes the form must compose a web page to send back to the user, this is usually just a confirmation of the form data being received. We will learn later in this lesson, that you can just redirect to another page after processing without generating a page.
Note that the option input builds an array of answers, and this array is a element in the $_POST array with the key set by the name attribute of the select tag. And the name must end in [] for it to work. (p204 line 10)
The author uses plain text prior to the text fields to label them, this is old school and you should not do it. Use the new label tag instead.
Read this short page about the label tag:
The HTML Label Tag
Also play my video:
PHP Form protocol
for more information on how forms are processed.
Question:
With this form, which php expression would look up the age entered from the computeAge.php program?
<form action='computeAge.php' method='POST'>
<p><label for= 'age'>Type the age of your car: </label>
<input type='text' name='carage' id='age' /></p>
<p><input type='submit' value='submit' /></p>
POST['carage']
$_POST[carage]
$_POST['age']
$_POST['carage']
You have completed 0% of the lesson
0%
◄ Strings,Dates, and Times ($$$)
Jump to...
Jump to...
Read Me First - Orientation
Syllabus
Welcome Video
GJenkins Video Library (PHP/MySQL Class)
PHP language reference documentation
Installing the software for the course
Accessing your Web Server
W3Schools tutorials (excelent reference)
KillerPHP.com Video Library (great extra material)
News forum
Student forum - a place for students to talk to each other
Download a Copy of this Course
Instructor comments on Chapter 1
Base Level Learning Outcomes Survey ($$$)
Basic HTML ($$$)
CSS Lesson ($$$)
Assignment: Create and publish your first web file ($$$)
Using PHP program ($$$)
your base php page
Assignment: Publish your PHP program ($$$)
Assignment: create a new PHP program ($$$)
Topic 1 Quiz ($$$)
variables and data types ($$$)
Play KillerPHP.com video on creating variables
Play KillerPHP.com video on print and variable expansion
Assignment: Chapter 5 variables ($$$)
Assignment: variables activity ($$$)
Assignment: comparisons activity ($$$)
Flow Control ($$$)
Assignment: color table ($$$)
Assignment: Day of the Weeks ($$$)
functions ($$$)
Video on calling functions (step by step explained)
Assigment: createTable4
Topic 2 Quiz ($$$)
Arrays ($$$)
Assignment: Deal Cards ($$$)
Objected Oriented PHP (OOP)
Video: Example of creating and using classes (Card Deck)
Assignment: Class Deck ($$$)
Strings,Dates, and Times ($$$)
Assignment: Guessing Game ($$$)
Assignment: Birthday ($$$)
Assignment: Chuck-a-luck ($$$)
Topic 3 Quiz ($$$)
** Link to topic 3 videos
Play this video about file paths in PHP
Uploading Files ($$$)
Program to upload Picture ($$$)
About State and Stateless web pages
Cookies ($$$)
Sessions ($$$)
Assignment: Guessing Game 2 ($$$)
using files ($$$)
Assignment: Visitor count ($$$)
Assignment: Working with Images ($$$)
Topic 4 Quiz ($$$)
NOTE: how to set file/folder permissions
Understanding Databases
MySQL Basic Data Types and CREATE TABLE ($$$)
Building a database from the command line (READ and VIEW)
Program: Build a DB using SSH ($$$)
Basic SQL Commands ($$$)
Play this video introducing phpMyAdmin
Play this video on how to create a DB in phpMyAdmin and enter data
Program: Create a Database design
Project: Import two databases
Lab: Writing SQL statements
Program interface to MySQL from PHP ($$$)
CRUD basics
Program: Contacts
About your final project
Mailing List ($$$)
Address Book ($$$)
Discussion Forum ($$$)
Store Front / Shopping Cart ($$$)
Calendar ($$$)
Extra Credit Survey ($$$)
Assignment: Guessing Game ($$$) ►