Jump to content

Problem With Php Form Script


shinteyz

Recommended Posts

My form is located on:

 

http://dhonveliparadise.com/book-adaaran-club-rannalhi.html

 

And heres the php code thats used to send the email:

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$rooms = $_POST['rooms'];
$adults = $_POST['adults'];
$children = $_POST['children'];
$meal = $_POST['meal'];
$arrival = $_POST['arrival'];
$dept = $_POST['dept'];
$country = $_POST['country'];
$number = $_POST['number'];
$message = $_POST['message'];
$to = "[email protected]";
$headers = "From: ".$email. "\r\n";
$subject = "Submitted application";
$msg = $name . " has sumitted a form!\r\n";
$msg .= "Pwd: " . $rooms . "\r\n";
$msg .= "Pwd: " . $adults $children $meals $arrival $dept $country $number $message . "\r\n";
$msg .= "email address: " . $email . "\r\n";
mail($to, $subject, $msg, $headers);
echo ("Mail processed.");
?>

 

 

Earlier I was receiving emails alright, but they were blank. And since I added method=post to my form, I am just not receving email at all!

Link to comment
https://forums.phpfreaks.com/topic/269442-problem-with-php-form-script/
Share on other sites

I'm not 100% positive as to why that could be, but something I do notice is you're using

$msg .= "Pwd: " . $adults $children $meals $arrival $dept $country $number $message . "\r\n";

 

And I believe those all need to be concat'd with periods, not just between the double quotes, making it look like this:

$msg .= "Pwd: " . $adults . $children . $meals . $arrival . $dept . $country . $number . $message . "\r\n";

 

Hope I've helped, let me know if this works for you!

Hey it works now. but they are all on the same line.

What if I want them each on a new line?

 

Thanks much

 

Glad it's working for you. To put them all on a new line you just need to add

$variable . "\r\n" . $more variables . "\r\n"

Just like you did with the rooms one above it.

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.