Jump to content

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 = "champareyz@live.com";
$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.

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.