douza Posted September 24, 2006 Share Posted September 24, 2006 Hi,I have a contact form on a small webiste and have used code from various sources. But I have two small problems that I cant seem to work out.1. Once submitted it opened a new browser unitl I added this small piece of code but Im not sure its the right thing to do to stop it. ( _root.c, )Also nothing is coming through just a blank email I thing its something to do with the my_lv.namePlease find below the code from the flash site and the pkm.php file to see if you can spot any errors[quote]#This is from the page#stop ();System.useCodePage = true;loadText = new LoadVars();loadText.load("contents/webmail.txt");loadText.onLoad = function (){title.htmlText = this.title;content.htmlText = this.content;};function sendForm () {my_lv = new LoadVars ();my_lv.name = _parent.name_txt.text;my_lv.email = _parent.email_txt.text;my_lv.message = _parent.message_txt.text;my_lv.send ("http://ccgi.douza.plus.com/webmail/email.php",_root.c, "POST");nextFrame();}send_btn.onRelease = function () {if (name_txt == "" || email_txt == "" || message_txt == "") {status_txt = "Please complete the form";} else {status_txt.text = "";sendForm ();}};[/quote][quote]#This is from the php file#<?php$sendTo = "email@pkmironing.co.uk";$subject = "Webmail from PKM Ironing Service";$headers = "From: ". $_POST["my_lv.name"] . "<" . $_POST["my_lv.email"] .">\r\n";$headers .= "Reply-To: " . $_POST["my_lv.email"] . "\r\n";$headers .= "Return-path: " . $_POST["my_lv.email"];$message = $_POST["my_lv.message"];mail($sendTo, $subject, $message, $headers);?>[/quote]_________________Best RegardsMarshy ::)email@douza.co.uk Quote Link to comment Share on other sites More sharing options...
xyn Posted September 24, 2006 Share Posted September 24, 2006 [color=red]EDIT:Try the below code, I've kinda updated my little error :-[[/color]The only problem i establish is you're missing quotes from your headers...[code=php:0]<?php$sendTo = "email@pkmironing.co.uk";$subject = "Webmail from PKM Ironing Service";$headers = "From: ". $_POST["my_lv.name"] . "<" . $_POST["my_lv.email"] .">\r\n";$headers .= "Reply-To: " . $_POST["my_lv.email"] . "\r\n";$headers .= "Return-path: " . $_POST["my_lv.email"];$message = $_POST["my_lv.message"];mail($sendTo, $subject, $message, "$headers");?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.