Problems setting up my forms (was: Forms)


hi

 

i'm having trouble setting forms, when send message no pop message says sent recieve email no content.

 

can please advise me? 2 php , html code below.

 

html code:

<form method="post" id="contactform">

                                    <div class="row">

                                        <div class="span4">

                                            <input type="text" class="prepared-input w100" id="contactname" value="name">

                                        </div>

                                        <div class="span4">

                                            <input type="email" class="prepared-input w100" id="contactemail" value="e-mail">

                                        </div>

                                    </div>

                                    <div class="divide10 hidden-phone"></div>

                                    <textarea  id="contactmessage" class="prepared-input w100" rows="3">message</textarea>

                                    <div class="divide10"></div>

                                    <input id="from_comment_go" type="submit" class="btn btnmc1 white" value="send message">

  </form>

 

php code:

<?php

$to = 'holidaylettorquay@lilycot.co.uk';

 

 

//language options

$contact_labelmailhead = 'contact form email';

$contact_labelmailsubject = 'contact form email from';

$contact_labelname = 'name';

$contact_labelemail = 'email';

$contact_labelmessage = 'message';

 

$name = trim($_post['name']);

$email = trim($_post['email']);

$message = str_replace(chr(10), "<br>", $_post['message']);

 

$body = "<html><head><title>$contact_labelmailhead</title></head><body><br>";

$body .= "$contact_labelname: <b>" . $name . "</b><br>";

$body .= "$contact_labelemail <b>" . $email . "</b><br>";

$body .= "$contact_labelmessage:<br><br><b>" . $message . "</b><br>";

$body .= "<br></body></html>";

 

$subject = $contact_labelmailsubject.'info@lilycot.co.uk' . $name;

$header = "from: $email\n" . "mime-version: 1.0\n" . "content-type: text/html; charset=utf-8\n";

 

mail($to, $subject, $body, $header);

 

 

?>

the name attribute of form fields missing.they must match $_post['name'];

 

$name = trim($_post['name']);

$email = trim($_post['email']);

$message = str_replace(chr(10), "<br>", $_post['message']);

 

 

see below: name="name", name="email", name="message"

 

 

<input type="text" name="name" class="prepared-input w100"  id="contactname" value="name">

 

 

<input type="email" name="email" class="prepared-input w100" id="contactemail" value="e-mail">

 

 

<textarea  id="contactmessage" name="message" class="prepared-input w100" rows="3">message</textarea>



More discussions in Dreamweaver support forum


adobe

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP