View Single Post
  #1  
Old 2nd October 2012, 03:17
zm1128 zm1128 is offline
Junior Member
 
Join Date: Oct 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP upgrade from PHP4 to PHP5

Hello, I am very new to coding, and need to convert the following script from PHP4 to PHP5. Can anyone please help in telling me what parts I need to change?

Thank you.

**********
<?php
$error=false;
if($_POST['posFName']!=null and $_POST['posLName']!=null and $_POST['posTitle']!=null and $_POST['posCompany']!=null and $_POST['posadd1']!=null and $_POST
['poscity']!=null and $_POST['posState']!=null and $_POST['poszip']!=null and $_POST['posEmail']!=null and $_POST['posphone']!=null and $_POST['stage']!=null){
require_once("PHPMailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$email="js@mail.com"; // Recipients email ID
$name="John Smith"; // Recipient's name
$mail->From = "webform@email.com";
$mail->FromName = "My Company";
$mail->AddAddress($email,$name);
$mail->AddAddress("jjs@mail.com","Jack Smith");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Live Demo Request Information";
$mail->Body = "<p>You have a new mail from Live Demo Section.<br/><br/>First Name : ".$_POST['posFName']."<br />Last Name : ".$_POST['posLName']." <br />Title : ".
$_POST['posTitle']."<br />Company : ".$_POST['posCompany']."<br />Address 1 : ".$_POST['posadd1']."<br />Address 2 : ".$_POST['posadd2']."<br />City : ".$_POST
['poscity']."<br />State : ".$_POST['posState']."<br />Email : ".$_POST['posEmail']."<br />Telephone - direct : ".$_POST['posphone']."<br />Please indicate the stage
of your initiative : ".$_POST['stage']; //HTML Body
$mail->AltBody = "<p>You have a new mail from Live Demo Section.<br/><br/>First Name : ".$_POST['posFName']."<br />Last Name : ".$_POST['posLName']." <br />Title : ".
$_POST['posTitle']."<br />Company : ".$_POST['posCompany']."<br />Address 1 : ".$_POST['posadd1']."<br />Address 2 : ".$_POST['posadd2']."<br />City : ".$_POST
['poscity']."<br />State : ".$_POST['posState']."<br />Email : ".$_POST['posEmail']."<br />Telephone - direct : ".$_POST['posphone']."<br />Please indicate the stage
of your initiative : ".$_POST['stage']; //Text Body
$mail->Send();
}else{
$error=true;
}
?>


**************************
Reply With Quote
Sponsored Links