/eg-259 ====== Introduction to PHP – Online Examples ====== **Supporting**: Contact Hours [[eg-259:lecture16|19]] to [[eg-259:lecture19|23]] **Session Dates**: Tuesday 20th March 2012 -- Wednesday 28th March 2012 **Prepared by**: Dr Chris P. Jobling **Adapted from**: Robert W. Sebasta, //Programming the World-Wide Web//, 3rd Edition, Addison Wesley, 2006. You can try the PHP examples from the lectures by following the following links. All the scripts have been installed in my virtual directory ''/eg-259/examples/'' on the web server eng-hope.swan.ac.uk. You'll find the source code in the lecture notes. ===== Examples from Contact Hour 19 ===== * Example 1: A simple example to illustrate a PHP document < [[/eg-259/examples/lecture16/today.php|today.php]], [[http://localhost/eg-259/examples/lecture16/today.php|today.php @ localhost]] > * Example 2: An example to illustrate loops and arithmetic < [[/eg-259/examples/lecture16/powers.php|powers.php]], [[http://localhost/eg-259/examples/lecture16/powers.php|powers.php @ localhost]] > ===== Examples from Contact Hour 20 ===== * Example 3: An example to illustrate several of the sorting functions < [[/eg-259/examples/lecture17/sorting.php|sorting.php]], [[http://localhost/eg-259/examples/lecture17/sorting.php|sorting.php @ localhost]]> * Example 4: The < [[/eg-259/examples/lecture17/word_table.php|word_table.php]], [[http://localhost/eg-259/examples/lecture17/word_table.php|word_table.php @ localhost]]> example illustrates the use of functions and regular expressions ===== Example from Contact Hour 22 ===== * Example 5: An simple popcorn ordering application in PHP < [[/eg-259/examples/lecture18/popcorn3.html|popcorn3.html]], [[http://localhost/eg-259/examples/lecture18/popcorn3.html|popcorn3.html @ localhost]]> ===== Examples from Contact Hour 23 ===== * Example 6: A Web Query from Perl CGI < [[/eg-259/examples/lecture19/carscgi.html|carscgi.html]], [[http://localhost/~eechris/eg-259/examples/lecture19/carscgi.html|carscgi.html @ localhost]]> [for information on how this is done see the [[eg-259:extras:dbandsql#database_access_with_perl_mysql|extra notes]]] * Example 7: A Web Query from PHP < [[/eg-259/examples/lecture19/carsdata.html|carsdata.html]], [[http://localhost/eg-259/examples/lecture19/carsdata.html|carsdata.html @ localhost]]> * Example 8: A Combined form and Web Query in PHP < [[/eg-259/examples/lecture19/access_cars2.php|access_cars2.php]], [[http://localhost/eg-259/examples/lecture19/access_cars2.php|access_cars2.php @ localhost]]>