calisonder Posted August 24, 2009 Share Posted August 24, 2009 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(); ?> Link to comment https://forums.phpfreaks.com/topic/171689-this-code-works-on-some-servers-but-not-others-any-tips/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 24, 2009 Share Posted August 24, 2009 What do you get when you add the following two lines of code immediately after the first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/171689-this-code-works-on-some-servers-but-not-others-any-tips/#findComment-905347 Share on other sites More sharing options...
the182guy Posted August 24, 2009 Share Posted August 24, 2009 I suspect your host does not allow the mail() function. This is common with free webhosts. Link to comment https://forums.phpfreaks.com/topic/171689-this-code-works-on-some-servers-but-not-others-any-tips/#findComment-905351 Share on other sites More sharing options...
calisonder Posted August 25, 2009 Author Share Posted August 25, 2009 It is a paid services, but if they don't allow the mail function, is there still a php code of some kind i can use to mail a form? Link to comment https://forums.phpfreaks.com/topic/171689-this-code-works-on-some-servers-but-not-others-any-tips/#findComment-905534 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.