esteeven
October 21st, 2009, 07:26 PM
I have an html form which contains this action :
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
The validation I have set up works (finally!!) using -
// import the validation library
require("validation.php");
Now that the form works, I would like to email the contents. Originally, before I started to validate the form, the form was processed by regform.php.
<form action="regform.php" method="post">
I tried -
// no errors! redirect the user to the thankyou page (or whatever)
else
{
//$message = "All fields have been validated successfully!";
// here you would either email the form contents to someone or store it in a database.
// To redirect to a "thankyou" page, you'd just do this:
header("Location: regform.php");
}
}
This worked ----- up to a point An email was sent but no data was included : just the field names.
__________________
I see from some examples I have found that the following is possible -
// no errors! redirect the user to the thankyou page (or whatever)
else
{
$message = "All fields have been validated successfully!";
// here you would either email the form contents to someone or store it in a database.
// To redirect to a "thankyou" page, you'd just do this:
// header("Location: thanks.php");
}
I have tried to use my regform.php to process the data post validation but I can't make it work. Am I on the right road?
Thanks
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
The validation I have set up works (finally!!) using -
// import the validation library
require("validation.php");
Now that the form works, I would like to email the contents. Originally, before I started to validate the form, the form was processed by regform.php.
<form action="regform.php" method="post">
I tried -
// no errors! redirect the user to the thankyou page (or whatever)
else
{
//$message = "All fields have been validated successfully!";
// here you would either email the form contents to someone or store it in a database.
// To redirect to a "thankyou" page, you'd just do this:
header("Location: regform.php");
}
}
This worked ----- up to a point An email was sent but no data was included : just the field names.
__________________
I see from some examples I have found that the following is possible -
// no errors! redirect the user to the thankyou page (or whatever)
else
{
$message = "All fields have been validated successfully!";
// here you would either email the form contents to someone or store it in a database.
// To redirect to a "thankyou" page, you'd just do this:
// header("Location: thanks.php");
}
I have tried to use my regform.php to process the data post validation but I can't make it work. Am I on the right road?
Thanks