Jump to content

PHP form sends once every 20 attempts...what's it up to?


chairmanMeow

Recommended Posts

Hello  :D

 

I'm on the verge of damaging my computer,  :'( please help...

 

The below is my first PHP script - it works about once every 20 attempts, sending the email message. I've tried moving the header bit around, so it's inside the if statement, but it is still only intermittently successful.

 

For the sake of this PC, please help out  :o

 

Best Wishes  :D

 

 

<?

function checkOK($field)

{

if (eregi("\r",$field) || eregi("\n",$field)){

die("Invalid Input!");

}

}

 

 

 

$select=$_POST['select'];

checkOK($select);

$name=$_POST['name'];

checkOK($name);

$email=$_POST['email'];

checkOK($email);

$confirmail=$_POST['confirmail'];

checkOK($confirmail);

$month=$_POST['month'];

checkOK($month);

$day=$_POST['day'];

checkOK($day);

$year=$_POST['year'];

checkOK($year);

$leaving=$_POST['leaving'];

checkOK($leaving);

$hour=$_POST['hour'];

checkOK($hour);

$minutes=$_POST['minutes'];

checkOK($minutes);

$ampm=$_POST['ampm'];

checkOK($ampm);

$going=$_POST['going'];

checkOK($going);

$flightnumber=$_POST['flightnumber'];

checkOK($flightnumber);

$pay=$_POST['pay'];

checkOK($pay);

$song=$_POST['song'];

checkOK($song);

$comments=$_POST['comments'];

checkOK($comments);

$to="[email protected]";

$message="Message Type: $select\n\nName: $name\n\nEmail: $email\n\n$confirmail\n\nDate of Journey: $month, $day, $year\n\nLeaving From: $leaving\n\nDeparture Time: $hour:$minutes $ampm\n\nGoing to: $going\n\nFlight Number: $flightnumber\n\nPayment Method: $pay\n\nSong Requests: $song\n\nComments: $comments";

 

header('Location:http://www.kabeoke.com');

if(mail($to,"Slap it - booking/enquiry from Kabeoke.com!",$message,"From: $email\n")){

 

}

else

{

echo "There was a problem sending the mail. Please check that you filled in the form correctly.";

}

 

 

?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.