Jump to content

This code works on some servers but not others, any tips?


calisonder

Recommended Posts

Hi,

 

 

I'm not a coder but I have a simple PHP script that I always use in my contact forms on websites.  I usually use godaddy servers which have PHP Version 5.2.5 installed and the script works fine. 

 

Unfortunately, the site I am working on is hosted by yahoo and the PHP Version on their servers is Version 4.3.11.  The script does not work on there servers, and PHP is enabled.  I tested the website I am working on on my own Godaddy servers and the the form works fine, but once I upload it to the yahoo servers it does not work. 

 

Is the code I'm using written in a newer version of PHP which won't allow it to work on Yahoo servers?  Thats the only thing I can think of.  If so, can someone give me some hints on how to modify the code to work on those yahoo servers. 

 

Thanks to everyone in advance. 

 


<?php
/*
   Flash Mail Form
*/
// Create local PHP variables from the info the user gave in the Flash form
$senderName   = $_POST['userName'];
$senderEmail     = $_POST['userEmail'];
$senderPhone     = $_POST['userPhone'];
$senderAddress     = $_POST['userAddress'];
$senderMessage = $_POST['userMsg'];



// Strip slashes on the Local variables
$senderName   = stripslashes($senderName);
$senderEmail     = stripslashes($senderEmail);
$senderPhone     = stripslashes($senderPhone); 
$senderAddress     = stripslashes($senderAddress); 
$senderMessage   = stripslashes($senderMessage); 


$to = "[email protected]";


     // Place sender Email address here
    $from = "$senderEmail ";
    $subject = "Contact from your site";
    //Begin HTML Email Message
    $message = <<<EOF
<html>
  <body bgcolor="#FFFFFF">
<b>Name</b> = $senderName<br /><br />
<b>Email</b> = <a href="mailto:$senderEmail">$senderEmail</a><br /><br />
<b>Phone Number</b> = $senderPhone<br /><br />
<b>Address</b> = $senderAddress<br /><br />
<b>Message</b> = $senderMessage<br />
  </body>
</html>
EOF;
   //end of message
    $headers  = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n";
    $to = "$to";

    mail($to, $subject, $message, $headers);

exit();
?>

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.