Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi All
I have searched for an answer to this one but no luck.
I have an HTML form that passes fields to a PHP mailscript that validates the input and sends the mail OK, so no problem so far.
Where I do have a problem is that I want to use the same fields in my next form.
I can call the next form OK with the header as below:Code: Select all
mail( "a test@testmail.co.uk", "New Advert Submission",
$message2, "From: $email" );
header( "Location: infopass.php" );Can anyone suggest the simplest way to achieve this?
TIA Gary
NB full code of my mail.php is below
Code: Select all
<?php
$name = $_REQUEST['name'] ;
$company = $_REQUEST['company'] ;
$email = $_REQUEST['email'] ;
$email2 = $_REQUEST['email2'] ;
$adverttype = $_REQUEST['adverttype'] ;
$adcat= $_REQUEST['adcat'] ;
$adcontent = $_REQUEST['adcontent'] ;
$message2 =
"Advert submission from: $name \n
Company: $company \n
Email Address: $email \n
Advert Type: $adverttype \n
Category: $adcat\n
Advert Content: \n $adcontent" ;
if (!isset($_REQUEST['email']))
{header( "Location: online.htm" );}
elseif (empty($name)) { ?>
<html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
You have not included your NAME in your advert submission. Please press the BACK button on your browser and add your name.
</p>
</body>
</html>
<?}
elseif (empty($email)) { ?>
<html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
You have not included your EMAIL ADDRESS in your advert submission. Please press the BACK button on your browser and add your Email Address.
</p>
</body>
</html>
<?}
elseif (empty($adcontent)) { ?>
<html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
You have not included any CONTENT in your advert submission. Please press the BACK button on your browser and add your content.
</p>
</body>
</html>
<?}
elseif ($email != $email2) { ?>
<html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
Your email confirmation does not match your email address. Please press BACK on your browser and make sure that both email addresses are the same.
</p>
</body>
</html>
<?}
else {
mail( "a test@testmail.co.uk", "New Advert Submission",
$message2, "From: $email" );
header( "Location: infopass.php" );
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]