View Single Post
  #1  
Old 02-28-2006, 11:41 AM
henrybaker henrybaker is offline
Private
 
Join Date: Jan 2006
Posts: 3
Default Form Validation and Email - Please Help Me...I'm really struggling...

Hi,

I created a feednack page with a simple data capture form. All I want to do is validate the customers inputs e.g. make sure the mail address is a mail address and then when the data is correct send them to a thanks page and mail me the data.

To teach myself the process I've been through the threads by Pablo and created the two pages. The form page and the page with the .php to process the form.

Here's the php script I'm using on the second page...

<?php

@$Email = addslashes($_POST['Email']);
function RecursiveMkdir($path)
{
if (!file_exists($path))
{
RecursiveMkdir(dirname($path));
mkdir($path, 0777);
}


if (strlen($Email) == 0 )
{
header("Location: index.html");
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $Email))
{
header("Location: index.html");
exit;
}


$pfw_header = "From: $Email\n"
. "Reply-To: $Email\n";
$pfw_subject = "Data submitted from FeedbackForm";
$pfw_email_to = "henry@broadway-marketing.com";
$pfw_message = "Modalita_Risposta: $Modalita_Risposta\n"


. "Email: $Email\n"

*****($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
header("Location: index.html");
?>

The test site is at www.guaranteed-mlm-success.com/FF.html

Please can anyone help??

Henry.
Reply With Quote