I have this script which I use for a flash based site - its an email script that collects the posted info and forwards it to the appropriate email box - I cobbled this together with some help from this forum __ I'm not a php guy.
Now I'm using this same script from a basic html form (post) and would rather have it go to a specific page rather than echoing a sentence in a blank page -- is it possible to change the "echo" part of this script to display a page instead?
here is the
Now I'm using this same script from a basic html form (post) and would rather have it go to a specific page rather than echoing a sentence in a blank page -- is it possible to change the "echo" part of this script to display a page instead?
here is the
Code:
<?php
//Create a temporary name for accepting the variable sent by Flash
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comment = $_POST['comment'];
//Some fields entered contained whitespace and we dont want them, so use function trim() to
//delete away whitespace
$name=trim($name);
$email=trim($email);
$phone=trim($phone);
$website=trim($website);
// We use StripSlashes to delete away unwanted backslashes '\'
$comment=StripSlashes($comment);
//We are going to include the website field, and company field insid the $comment here
$message ="Contact Name : $name\n";
$message .="Contact Email : $email\n";
$message .="Contact Phone : $phone\n";
$message .="Comments : $comment";
//Modified this to suit your email address
$sendto='name@site.com';
//Modified this for displaying the subject in your mail
$subject="Contact Form";
mail($sendto,$subject,$message,"From: $name <$email>") or die("Failure");
//clear all variables
$name='';
$email='';
$phone='';
$comment='';
$message='';
echo ("you have submitted successfully");
?>