I'm working on form to email a link to another person and would like to make some feilds required. So i have written the script to check for a number of conditions and either send the message or redirect. But i am having no luck with the redirects. The meta tag shown just keeps reload the same page, and i have to call includes and functions to evaluate the conditions so i keep getting errors when i try the header method. please help.
here is the script
<?
// call function file
include("/home/north2/includes/temnoca_functions.inc");
include("/home/north2/includes/emall_functions.inc");
// connect and log hit
temnoca_connect();
log_hit();
$name = trim($name);
$your_email = trim($your_email);
$their_email = trim($thier_email);
$message = trim($message);
if($name && validate_email($your_email) && validate($their_email))
{ //send mail
}
else
{
if (!$name)
$name_error = "You did not enter your name";
if (!validate_email($your_email))
$their_email_error = "The have entered an invalid email address";
if (!$your_email)
$their_email_error = "You did not enter your email address";
if (!validate_email($your_email))
$their_email_error = "The have entered an invalid email address";
if (!$their_email)
$their_email_error = "You did not enter thier email address";
if (!validate_email($their_email))
$their_email_error = "The have entered an invalid email address";
echo "<META HTTP-EQUIV='REFRESH' content='1; URL='http://emall.northernontario.ca/email_link.php')";
}
// email size header function
email_header ("email_thank_you.gif", "Thank You");
?>
<form action='email_link_sent.php' method='post' name='email_link'>
<table width='100%' border='0' cellspacing='0' cellpadding='2'>
<tr class='large_bodytext'>
<td colspan='2' align='center'><br>Thank you. The message was sent to the address you entered.<br><br><br></td>
</tr>
<tr class='medium_bodytext'>
<td width='115'>Your Name * </td>
<td><? echo $name ?></td>
</tr>
<tr class='medium_bodytext'>
<td width='115'>Your Email * </td>
<td><? echo $your_email ?></td>
</tr>
<tr class='medium_bodytext'>
<td width='115'>Their Email * </td>
<td><? echo $their_email ?></td>
</tr>
<tr class='medium_bodytext'>
<td valign='top' width='115'>Message</td>
<td valign='top'><? echo $message ?></td>
</tr>
</table>
<?
// email size footer function
email_footer("<input type='image' src='images/layout/send.gif' alt='Send' border='0' height='20' width='120' value='Submit'>");
?>
any assistance would be greatly appreciated.