PHP_SELF passes the data back to the same page, where you could have functions that show the form, functions that process the from and functions that do something with the data (like email and save to a database)
Code:
<?php
if(isset($_POST['submit']))
{
processForm();
}else{
showForm();
}
function processForm()
{
//clean and validate data here
//all data gets put into $arrayData
//call function to save t db
saveData($arrayData);
//call to email the data
function emailData($arrayData);
}
function showForm($data='')
{
//show form
//$data is the array that holds the values of the form for redisplay
}
function emailData($data)
{
//create email message
}
function saveData($data)
{
//really this should be in an include file that holds a variety of DB
//functions like saveData, getData, deleteData, updateData
//more of a DB class of some kind
}
_________________
Lostboy
Cat, the other other white meat
Please read
Posting Etiquette before posting
You can always try
Google