Help with simple php script

I am trying to finish my wedding website up with little knowledge or training in the area of html or php. I have been tryin to get this form to work for weeks and I am getting close to my deadline and just need a little help. I just need the following code to send an email to my online webmail when someone RSVPs

HTML code[code]

Your Name



Email Address



Guests Attending
12345678910

                        <span class="dot-left"></span>
                        <span class="flower"><img alt="" src="images/flower2.png"></span>
                        <span class="dot-right"></span>
                    </div>
                    <!--event box END-->
                    <!--event box start-->
                    <div class="guest-book relative">
                    	<div class="select resize">
                        	<h2>Select the event(s) you will be attending.</h2>
                            <span>
                            	<input name "attending[]" type="checkbox" value="Bridal Shower OK">
                                <h5>Bridal Shower OK </h5><small>TBA</small>
                            </span>
                            <span>
                            	<input name="attending[]" type="checkbox" value="Bridal Shower LA">
                                <h5>Bridal Shower LA </h5><small>TBA</small>
                            </span>
                            <span>
                            	<input name="attending[]" type="checkbox" value="Ceremony">
                                <h5>Ceremony </h5><small>May 30th - 6:30pm</small>
                            </span>
                            <span>
                            	<input name="attending[]" type="checkbox" value="Reception">
                                <h5>Reception </h5> <small>May 30th - 7:30pm</small>
                            </span>
                        </div>
                        <span class="dot-left"></span>
                        <span class="flower"><img alt="" src="images/flower2.png"></span>
                        <span class="dot-right"></span>
                    </div>
                    <!--event box END-->
                    <!--event box start-->
                    <div class="guest-book relative"> 
                        
                            <span>
                                <label>Comments:</label>
                                <textarea name="comments"></textarea>
                             </span>
                             <button class="leave-message">Submit RSVP</button>[/code]

PHP Code[php]

<?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "[email protected]"; $email_subject = "RSVP"; $email_message = "Form details below.\n\n"; $guestsdata = $_REQUEST['guests']; $email_message .= "First Name: "$name ."\n"; $email_message .= "Email: "$email ."\n"; $email_message .= "Guests Attending: " $guestsdata ."\n"; $email_message .= "Attending what event : "$attending ."\n"; $email_message .= "Comments: "$comments ."\n"; // create email headers $headers = 'From: '.$field_2."\r\n". 'Reply-To: '.$field_2."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?>

Thank you for contacting us. We will be in touch with you very soon.

<?php } ?>[/php]

What issue are you having?

It is not completing the script and sending the email

Remove the error suppressant from mail (@) to see if it is giving a warning.

I see some errors here.

This should be…

[php] $email_message .= “First Name: “$name .”\n”;
$email_message .= “Email: “$email .”\n”;
$email_message .= “Guests Attending: " $guestsdata .”\n";
$email_message .= “Attending what event : “$attending .”\n”;
$email_message .= “Comments: “$comments .”\n”;[/php]

This.

[php] $email_message .= “First Name: " . $name .”\n";
$email_message .= “Email: " . $email .”\n";
$email_message .= “Guests Attending: " . $guestsdata .”\n";
$email_message .= “Attending what event : " . $attending .”\n";
$email_message .= “Comments: " . $comments .”\n";[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service