hi guys, i know this question has been asked numerous times and normally it has to do with either missing brackets or semi-colons.... however i am converting a couple of pages from asp to php and finished the first page. i get the following parse error:
arse error: syntax error, unexpected T_VARIABLE in ...../ocheckout1.php on line 28.
below is the code, can someone please advise me on where the error lies as i went through this a couple of times already and cannot seem to find the problem....
<?php
session_start();
session_register("Name_session");
session_register("Email_session");
session_register("Password_session");
session_register("ologged_session");
session_register("olooged_session");
?>
<?php
if ($_POST["action"]=="submit_buy_nomember")
{
$hostname='localhost';
$user='username';
$pass='password';
$dbase='database';
$connection = mysql_connect("$hostname" , "$user" , "$pass")
or die ("Can't connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
$objDBCommand_ActiveConnection=$connection;
$objDBCommand_CommandText="select * from Ausers where Email =?";
$objDBCommand_CommandType=1;
$objDBParam= $objDBCommand_CreateParameter="@Email" ;
$objDBCommand_Parameters=$Append$objDBParam ;
$objDBCommand_Parameters="@Email"=$_POST["Email"];
$objDBParam=null;
$objDBRecords= $objDBCommand_Execute=$if$objDBRecords->EOF<>true;
header("Location: "."ocheckout1.php?error=This email is already signed up as a member, please try again.");
}
$objDBCommand=null;
mysql_close($connection);
$connection=null;
$hostname='localhost';
$user='ourfullpot_new';
$pass='ofppass';
$dbase='ourfullpot_db';
$connection = mysql_connect("$hostname" , "$user" , "$pass")
or die ("Can't connect to MySQL");
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");
$objDBCommand is of type "ADODB.Command"
$objDBCommand_ActiveConnection=$connection;
$objDBCommand_CommandText="insert into Ausers (Email, Name, Password) Values (?,?,?)";
$objDBCommand_CommandType=1;
$objDBParam=$objDBCommand_CreateParameter="@Email";
$objDBCommand_Parameters=$Append$objDBParam;
$objDBCommand_Parameters="@Email")=$_POST["Email"];
$objDBParam=null;
$objDBParam=$objDBCommand_CreateParameter="@Name";
$objDBCommand_Parameters=$Append$objDBParam;
$objDBCommand_Parameters="@Name")=$_POST["Name"];
$objDBParam=null;
$objDBParam=$objDBCommand_CreateParameter="@Password";
$objDBCommand_Parameters=$Append$objDBParam;
$objDBCommand_Parameters="@Password")=$_POST["Password"];
$objDBParam=null;
$objDBCommand_Execute=$If$err<>0;
$VarUpdateStatus="An error occured, please try again.";
}
else
{
$VarUpdateStatus="You have signed up succesfully";
$_SESSION['Name']=$_POST["Name"];
$_SESSION['Email']=$_POST["Email"];
$_SESSION['Password']=$_POST["Password"];
$_SESSION['ologged']="1";
$vardate=$DATEADD["h"][7][time()];
// $Mail is of type "Persits.MailSender"
$Mail->Host="localhost";
$Mail->From="cpcjup@mweb.co.za";
$Mail->FromName="Our Full Potential";
$Mail->AddAddress$_SESSION['Email'];
$Mail->Subject="Thank you for joining Our Full Potential";
$cmb=chr(10).chr(13);
$e="";
$e=$e."<b>Username:</b>".chr(13).$_POST["Email"].$cmb."<br>";
$e=$e."<b>Password:</b>".chr(13).$_POST["Password"].$cmb."<br><br>";
$e=$e."<b><a href='http://www.ourfullpotential.com/ologin.asp'>Click here to login:</a></b><br><br>";
$e=$e."<b>Click below for your free podcasts:</b><br><a href='http://www.ourfullpotential.com/clips/clip1.mp3'>Clip 1</a><br>";
$e=$e."<a href='http://www.ourfullpotential.com/clips/clip2.mp3'>Clip 2</a><br>";
$e=$e."<a href='http://www.ourfullpotential.com/clips/clip3.mp3'>Clip 3</a><br>";
$e=$e."<a href='http://www.ourfullpotential.com/clips/clip4.mp3'>Clip 4</a><br>";
$Mail->Body="<html><body><font face='verdana' size='2'><img src='http://www.ourfullpotential.com/images/email.gif'><br><br>Dear ".$_POST["Name"].",<br><br> Thank you for joining the Free Membership area of Our Full Potential.<br><br>".$e.
"</font></body></html>";
$Mail->IsHTML=true;
$Mail->Send;
if ($err!=0)
{
$VarEmailStatus="Email failed to send";
}
else
{
$VarEmailStatus="Email send sucessfull";
}
header("Location: "."ocheckout2.php");
set objDBCommand = Nothing
objDBConnection.Close
set objDBConnection = Nothing
ELSEIF request.form("action") = "submit_buy_member" THEN
set connection = Server.CreateObject("ADODB.Connection")
connection.ConnectionTimeout = 15
connection.CommandTimeout = 30
connection.Open ("PROVIDER=SQLOLEDB;DATA SOURCE=host,1444;UID=username;PWD=password;DATABASE=database")
set objDBCommand = Server.CreateObject("ADODB.Command")
objDBCommand.ActiveConnection = connection
objDBCommand.CommandText = "select * from Ausers where Email =? and Password =?"
objDBCommand.CommandType = 1
set objDBParam = objDBCommand.CreateParameter("@Email",200,1,50)
objDBCommand.Parameters.Append objDBParam
objDBCommand.Parameters("@Email") = Request.form("email")
set objDBParam = Nothing
set objDBParam = objDBCommand.CreateParameter("@Password",200,1,255)
objDBCommand.Parameters.Append objDBParam
objDBCommand.Parameters("@Password") = Request.form("password")
set objDBParam = Nothing
set objDBRecords = objDBCommand.Execute
if objDBRecords.EOF <> True then
Session("olooged") = "1"
Session("Name") = objDBRecords.fields("Name")
Session("Email") = Request.form("email")
Session("Password") = Request.form("password")
Response.Redirect("ocheckout2.asp")
else
VarLoginError = "Incorrect Username and/or Password"
end if
set objDBCommand = Nothing
connection.Close
set connection = Nothing
END IF