Jump to content

Archived

This topic is now archived and is closed to further replies.

douza

Hi not sure if this is a php questions or flash

Recommended Posts

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

[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 Regards

Marshy  ::)
email@douza.co.uk

Share this post


Link to post
Share on other sites
[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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.