Hey guys. Here's the contact form I got: LIGHT FORUM - http://web-kreation.com/demos/LightForm Im trying to implement that on to here: www.aklwoodwork.com/contact.html Can anyone give me a hand or point me in the right direction please. Thanks again.
First you are going to have to implement JQuery. From the look of your source you have. You will then have to use a back-end language like PHP or ASP to take the text they entered in the fields and then email it to the specified email address(es) you want. If you want help on this don't hesitate to PM me.
Hey Kind. Thanks for the tip, would you mind telling me what script I need to get? Preferably a free script. Thanks.
I can help you out with that. For your form you want this on the same page. <?php //checks to see if the name was sent if (!empty($_POST['name'])) { //setup the address you want to email to $to = 'youremailaddress@email.com'; //setup the subject of the email $subject = 'AKL Woodwork Contact Us'; //add the users name to the message $message = 'Name: '.$_POST['name']."\n"; //add the users website to the message if it exists if (!empty($_POST['website'])) { $message .= 'Website: '.$_POST['website']."\n"; } //add their message to the message $message .= 'Message: '.stripslashes($_POST['message']); //setup the header information $headers = 'From: '.$_POST['email']."\r\n".'Reply-To: '.$_POST['email']; //setup your message to allow 70 characters and then wrap them for the message $message = wordwrap($message, 70); //mail the message mail($to, $subject, $message, $headers); //print a message that it was mailed echo "<p>Thank you for your response.</p>"; } //else if they have not submitted the form else { ?> <!-- Put all of your form stuff here --> <?php } ?> Code (markup):
Hey mate. So here's what i understood, let me know if I've missed something... thanks again for the help (much appreciated) contact.html <FORM action="http://www.aklwoodwork.com/contact.php" method="post" class="ajax_form"> <FIELDSET><H3><SPAN><SPAN class="cufon cufon-canvas" style="width: 53px; height: 18px; "><CANVAS width="69" height="21" style="width: 69px; height: 21px; top: -2px; left: 0px; "></CANVAS><SPAN class="cufon-alt">Send </SPAN></SPAN><SPAN class="cufon cufon-canvas" style="width: 27px; height: 18px; "><CANVAS width="42" height="21" style="width: 42px; height: 21px; top: -2px; left: 0px; "></CANVAS><SPAN class="cufon-alt">us </SPAN></SPAN><SPAN class="cufon cufon-canvas" style="width: 18px; height: 18px; "><CANVAS width="33" height="21" style="width: 33px; height: 21px; top: -2px; left: 0px; "></CANVAS><SPAN class="cufon-alt">a </SPAN></SPAN><SPAN class="cufon cufon-canvas" style="width: 39px; height: 18px; "><CANVAS width="56" height="21" style="width: 56px; height: 21px; top: -2px; left: 0px; "></CANVAS><SPAN class="cufon-alt">mail</SPAN></SPAN></SPAN></H3> <P class=""><INPUT name="yourname" class="text_input empty" type="text" id="name" size="20" value=""><LABEL for="name">Your Name*</LABEL> </P> <P class=""><INPUT name="email" class="text_input email" type="text" id="email" size="20" value=""><LABEL for="email">E-Mail*</LABEL></P> <P><INPUT name="website" class="text_input" type="text" id="website" size="20" value=""><LABEL for="website">Website</LABEL></P> <LABEL for="message" class="blocklabel">Your Message*</LABEL> <P class=""><TEXTAREA name="message" class="text_area empty" cols="40" rows="7" id="message"></TEXTAREA></P> <P> <INPUT type="hidden" id="myemail" name="myemail" value="Hello@AKLwoodwork.com"> <INPUT type="hidden" id="myblogname" name="myblogname" value="Leviation"> <INPUT name="Send" type="submit" value="Send" class="button" id="send" size="16"></P> </FIELDSET> <?php //checks to see if the name was sent if (!empty($_POST['name'])) { //setup the address you want to email to $to = 'Hello@AKLwoodwork.com'; //setup the subject of the email $subject = 'AKL Woodwork Contact Us'; //add the users name to the message $message = 'Name: '.$_POST['name']."\n"; //add the users website to the message if it exists if (!empty($_POST['website'])) { $message .= 'Website: '.$_POST['website']."\n"; } //add their message to the message $message .= 'Message: '.stripslashes($_POST['message']); //setup the header information $headers = 'From: '.$_POST['email']."\r\n".'Reply-To: '.$_POST['email']; //setup your message to allow 70 characters and then wrap them for the message $message = wordwrap($message, 70); //mail the message mail($to, $subject, $message, $headers); //print a message that it was mailed echo "<p>Thank you for your response.</p>"; } //else if they have not submitted the form else { ?> <!-- Put all of your form stuff here --> <?php } ?> </FORM> Code (markup):
Om is correct. Your file will have to be contact.php. Also, you will have to put your header and footer code in and your page info where I put the comment in. If you have any problems, feel free to post.
Hey guys. Thanks agian for the help. I'm new to this and having some issues I know how to change the extension to .php - however here's where I run into a problem; screenshot of my FTP contact.html -This is where i would like to have the contact form work contact.php -This is an Ajax script I was testing out, im not sure what Iam doing really, and Im not sure if it's connected to my contact form on contact.html So if I were to replace the contact.html to contact.php it would over ride the script. Would it be too much to ask if you can help me with the changes and give me the files so that I can just upload them, cause I'm a little confused folks Thanks again.
Here is the structure. *all of your code before the text (header, white page, etc.) *the code i gave you for the post check and response with the email *in the else put the code to display the form *after the else print the footer information (closing divs, footer, etc.) Then point to the php file and it will be the html file only with the email processing. The email processing will all be handled on the same page.
If you don't want to waste time with PHP and other programming issue, have a look at 123 Contact Form. You can make your contact form there, it's free, all you have to do is copy& paste the final HTML code on your contactus page.