Ok I made some changes and still have erros.
Here's the form:
Here's the modified code:Code:<form name="raffle" action="http://n2flash.com/raffle.php" method="post"> <input name="code" maxlength="25" size="20" type="text"><br> <input value="Submit" type="submit"> </form>
Still producing the same error. submitting a blank form directs to success page with an email generated. Any value directs to error page with no email sent.PHP Code:<?php
$usercode = $_POST['code'];
$realcode = array('1', '2', '3', '4', '5');
$match = "false";
foreach ($realcode as $value)
{
if(strcasecmp($realcode[$value], $usercode) == 0)
{
$match = "true";
}
}
if($match == "true")
{
$to = "info@n2flash.com";
$subject = "Raffle Code";
$email = "info@n2flash.com";
$message = $_REQUEST['code'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{header( 'Location: http://www.n2flash.com/success.html' ) ; }
else
{header( 'Location: http://www.n2flash.com/error.html' ) ; }
}
else
{
header( 'Location: http://www.n2flash.com/error.html' ) ;
}
?>
Mind boggling!



Reply With Quote


Bookmarks