Jump to content

PHP Contact Form in Flash "Failed"


pyakule

Recommended Posts

Hi, I'm using a PHP contact form on my flash site. It works fine on my yahoo web hosting account, but now it doesn't work since its been transferred to my client's GoDaddy account (which, I'm told, is using Windows Basic PHP 4).

 

When I fill out the form and hit send it just says: "Failed! Your message cannot sent." GoDaddy said that their Windows basic web hosting service only works with PHP 4. Is this code not PHP 4?

 

I am new to PHP so I have no idea what to do next. Any help would be greatly appreciated.

 

My send_email.php code:

 

<?php

$contact_name = $_POST['name'];

$contact_email = $_POST['email'];

$contact_subject = $_POST['subject'];

$contact_message = $_POST['message'];

 

if( $contact_name == true )

{

$sender = $contact_email;

$receiver = "[email protected]";

$client_ip = $_SERVER['REMOTE_ADDR'];

$email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\nFlash Contact Form";

$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();

 

if( mail( $receiver, "Flash Contact Form - $contact_subject", $email_body, $extra ) )

{

echo "success=yes";

}

else

{

echo "success=no";

}

}

?>

 

 

 

my send_email_auto_response.php code:

 

<?php

$contact_name = $_POST['name'];

$contact_email = $_POST['email'];

$contact_subject = $_POST['subject'];

$contact_message = $_POST['message'];

 

if( $contact_name == true )

{

$sender = $contact_email;

$receiver = "[email protected]";

$client_ip = $_SERVER['REMOTE_ADDR'];

 

$email_body = "Name: $contact_name \nEmail: $sender \n\nSubject: $contact_subject \n\nMessage: \n\n$contact_message \n\nIP: $client_ip \n\nFlash Contact Form provided by http://www.pyakule.com";

$email_body_auto_reply = "Hello $contact_name, \nThis is the auto reply message. Thank you. \n\nAdmin - http://www.flashmo.com";

 

$extra = "From: $sender\r\n" . "Reply-To: $sender \r\n" . "X-Mailer: PHP/" . phpversion();

$extra_auto_reply = "From: $receiver\r\n" . "Reply-To: $receiver \r\n" . "X-Mailer: PHP/" . phpversion();

 

mail( $sender, "Auto Reply - Re: $contact_subject", $email_body_auto_reply, $extra_auto_reply ); // auto reply mail to sender

 

if( mail( $receiver, "Flash Contact Form - $contact_subject", $email_body, $extra ) )

{

echo "success=yes";

}

else

{

echo "success=no";

}

}

?>

 

 

Thanks in advance for any assistance.

Link to comment
https://forums.phpfreaks.com/topic/194472-php-contact-form-in-flash-failed/
Share on other sites

Archived

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

×
×
  • 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.