Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 2nd October 2012, 04: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
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Only Problems since Updating from 3.0.3.3 to 3.0.4.1 mbay General 4 17th May 2012 13:56
ubuntu and nginx delgado2061 Installation/Configuration 0 28th November 2011 00:36
Problem with services!! banzaiwebstudio.com Installation/Configuration 7 19th May 2010 22:13
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 09:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 18:18


All times are GMT +2. The time now is 06:04.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.