View Full Version : contact form problem (php+flash)
my contact form just doesn't work. I cant find where the problem is. i use php here but i am not very good at that. can any one have a look at that and help me debug it. Thank you very much. source file attached below. thanks again..
Das123
04-11-2004, 05:19 PM
I had a quick look at the files and there are a couple of things that you can try within the PHP.
Your PHP script doesn't define the passed variables. You need to treat Flash loadVars as simply an HTML form and that the elements are just like HTML form elements. Your PHP should be...
<?php
$ToEmail = "daniel@ellusign.com";
$ToName = "";
#$ToName = "Daniel Cai";
$Name = $_POST['Name'];
$Email = $_POST['Email'];
$Message = $_POST['Message'];
$EmailBody = "Sent By: $Name\nSenders Email: $Email\nSenders Message: $Message\n\nMessage;
$EmailFooter="\nThis message was sent by: $Name from $REMOTE_ADDR If you feel that you recieved this e-mail by accident please contact us at www.ellusign.com";
$Message = $EmailBody.$EmailFooter;
mail($ToName." <".$ToEmail.">",$Subject, $Message, "From: ".$Name." <".$Email.">");
Print "_root.Mail.EmailStatus=Complete - Your mail has been sent";
?>
Changes are:
1. It is advisable to use <?php rather than just <?.
2. Add $_POST[] statements to read the passed variables.
3. It works, but you only need one shell-style comment '#', but usually single line comments are in the C++ style '//'.
Hope this helps.
Thank you very much Das123, im gotta have it a go
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.