subglobal1 link | subglobal1 link | subglobal1 link | subglobal1 link | subglobal1 link | subglobal1 link | subglobal1 link
subglobal2 link | subglobal2 link | subglobal2 link | subglobal2 link | subglobal2 link | subglobal2 link | subglobal2 link
subglobal3 link | subglobal3 link | subglobal3 link | subglobal3 link | subglobal3 link | subglobal3 link | subglobal3 link
subglobal4 link | subglobal4 link | subglobal4 link | subglobal4 link | subglobal4 link | subglobal4 link | subglobal4 link
subglobal5 link | subglobal5 link | subglobal5 link | subglobal5 link | subglobal5 link | subglobal5 link | subglobal5 link
subglobal6 link | subglobal6 link | subglobal6 link | subglobal6 link | subglobal6 link | subglobal6 link | subglobal6 link
subglobal7 link | subglobal7 link | subglobal7 link | subglobal7 link | subglobal7 link | subglobal7 link | subglobal7 link
subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link | subglobal8 link

HTML>PHP>MySQL>HTML

Send the data to an e-mail address

We will take the script from the first exercise and add some stuff at the bottom.

Note: The characters "//" before a line of code below denotes that the lines is a comment. It is there for your reference and is not read by the web browser.

<?php

//THIS IS WHERE THE CODE FROM THE FIRST EXERCISE GOES

//start building the mail string, this is what will be in the e-mail you receive
$msg = "Name: $_POST[fname] has [ecolor] eyes\n";

//set up the mail, who it goes to and what the subject line will be. Put it your e-mail address here
//so you can see if it works
$recipient = "david.clark@bvsd.org";
$subject = "I have lovely $_POST[ecolor] eyes ";

//send the mail
mail($recipient, $subject, $msg);
?>

Another note: These commands will only work on servers that are set up to accept them. In this case the php software knows where the mail utility is on the da Vinci Server and knows how to talk to it.

Assignment:

Change your initial form so it has two more fields:

email & subject

Change the form.php script so it reads:

$recipient = "$_POST[email]";
$subject = ""$_POST[subject]";

This lets your user decide where the form data should be send and what the subject line should be.

Upload and report the pages to me. As always, all design criteria learned previously should be used in creating this page.

CONTINUE