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="beepbeepyeah@kabeoke.com";

$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.";

}

 

 

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.