Jump to content


Photo

Hi not sure if this is a php questions or flash


  • Please log in to reply
1 reply to this topic

#1 douza

douza
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 24 September 2006 - 11:57 AM

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.name

Please find below the code from the flash site and the pkm.php file to see if you can spot any errors

#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.pl...il.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 ();
}
};


#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);

?>


_________________
Best Regards

Marshy  ::)
email@douza.co.uk

#2 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 24 September 2006 - 12:10 PM

EDIT:
Try the below code, I've kinda updated my little error :-[
The only problem i establish is you're missing quotes from your headers...
<?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");

?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users