Jump to content

Hi not sure if this is a php questions or flash


douza

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.