PDA

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


jgreco
02-27-2005, 01:53 PM
>>>>>>MASSIVE KUDOS TO THE FIRST ONE WHO HELPS ME ON THIS>>>>>

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:

.....

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

<br>
".$_GET['message']."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");
?>
<script>
resizeTo(300, 300)
//window.close()
</script>
.....

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.

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

CyanBlue
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... :)

jgreco
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.");
?>
<script>
resizeTo(350, 250)
window.close()
</script>