View Full Version : Im In Deep Crap - NEED HELP WITH PHP CONTACT US

02-27-2005, 01:53 PM

I have a contact us form on my flash movie. All fields are coded correctly for input text and the script looks like:


on (release) {
url_var = "server_option="+_root.server_option+"&recipient="+_root.recipient+"&first_name="+_parent.first_name+"&last_name="+_parent.last_name+"&email="+_parent.email+"&comments="+_parent.comments;
getURL("contact."+_root.server_option+"?"+url_var, "_blank", "GET");
_parent.first_name = "";
_parent.last_name = "";
_parent.email = "";
_parent.comments = "";


It is calling a file within the same directory called contact.php, which looks like:


$headers= "From:".$_GET['your_email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail($_GET['recipient'], $subject, "
<title>Contact letter</title>

</html>" , $headers);
echo ("Your message was successfully sent!");
resizeTo(300, 300)

now, the .swf was uploaded in binary and the php in ASCII, of course. I fill out the form, and hit submit, and all i get is a blank email from my hosting provider, 1&1.

I have verified that php is running on the server. Do i need to create a .htaccess file or something? Is there something obviously wrong with the script(s)?

THIS IS MY FIRST TIME...I really appreciate all the help. I will try to return the favor anyway I can...

Thanks Again.

John G.

02-27-2005, 06:10 PM
since no one has come forward to offer any assistance pro bono, i would like to offer a small cash prize (nothing bling bling), but a small token for your help. I really need this script to work, and would appreciate any help from someone who knows more about this then me.

02-27-2005, 08:08 PM
Howdy and Welcome... :)

I don't really see anything wrong there except that you are sending _root.server_option twice...

You might also want to trim out the HTML codes in the mail() function... Try it with something simple to make sure the mail() function works properly... and then move on to add more HTML codes in there to know where your problem exists... :)

02-28-2005, 02:05 AM
cyan, thanks man. it didnt quite work. i had to re-write it, and now it works. thanks.

$header='Content-type: text/html; charset=iso-8859-1';
$subject="Net Worth Media Information Request";
$rah= $_GET['first_name'].' '.$_GET['last_name'].' '.$_GET['email'].' '.$_GET['comments'];
mail($_GET['recipient'], $subject, $rah );

echo ("Your message was successfully sent! You may close this window now. We will contact you shortly.");
resizeTo(350, 250)