Page 1 of 1

Hepl with transition from PHP 4 to PHP 5

Posted: Mon Mar 16, 2009 10:18 am
by ldlouis
Hi all

I was using this php until my host upgrade to PHP 5

here is the code

Code: Select all

$my_email = info@ldfconsultant.com;
 
$continue = "prof_e.html";
 
if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
$message = "";
 
while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}
 
$message = stripslashes($message);
 
$subject = "Received from http://www.ldfconsultant.com";
 
$headers = "From: " . $_POST['Email'] . "\n" . "Return-Path: " . $_POST['Email'] . "\n" . "Reply-To: " . $_POST['Email'] . "\n";
 
mail($my_email,$subject,$message,$headers);
 
Thank you

Re: Hepl with transition from PHP 4 to PHP 5

Posted: Mon Mar 16, 2009 11:03 am
by Jonah Bron
What error message do you get when you run it? Remember, when posting on this forum, surround your code with [syntax=php](code here)[/syntax]

Re: Hepl with transition from PHP 4 to PHP 5

Posted: Mon Mar 16, 2009 11:37 am
by ldlouis
Jonah Bron wrote:What error message do you get when you run it? Remember, when posting on this forum, surround your code with

Code: Select all

(code here)

Code: Select all

$my_email = info@ldfconsultant.com;
 
$continue = "prof_e.html";
 
if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
$message = "";
 
while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}
 
$message = stripslashes($message);
 
$subject = "Received from http://www.ldfconsultant.com";
 
$headers = "From: " . $_POST['Email'] . "\n" . "Return-Path: " . $_POST['Email'] . "\n" . "Reply-To: " . $_POST['Email'] . "\n";
 
mail($my_email,$subject,$message,$headers);
 
<?php print stripslashes($_POST['Name']); ?>
 
No error message. It does not proccess any email. With PHP4 everything was working fine.

Thank you for the reply