Hepl with transition from PHP 4 to PHP 5

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ldlouis
Forum Newbie
Posts: 2
Joined: Mon Mar 16, 2009 10:10 am

Hepl with transition from PHP 4 to PHP 5

Post 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
Last edited by ldlouis on Mon Mar 16, 2009 11:44 am, edited 2 times in total.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Hepl with transition from PHP 4 to PHP 5

Post 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]
ldlouis
Forum Newbie
Posts: 2
Joined: Mon Mar 16, 2009 10:10 am

Re: Hepl with transition from PHP 4 to PHP 5

Post 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
Post Reply