Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Unexpected T_VARIABLE
Old 04-22-2006, 12:07 PM Unexpected T_VARIABLE
Average Talker

Posts: 15
Trades: 0
Alright, I'm trying to make it so that when you load this page it checks if you're logged in and displays one part of the code if you are, and another part if you arn't. Now I tested out the code, it worked with basic HTML, but now I get the following error.

Parse error: syntax error, unexpected T_VARIABLE in /home/.bafftub/jeffdunn/destroi.com/fulllogin.php on line 77

PHP Code:
<?PHP
// get the cookievars if they exist
$rememberCookieUname = @$HTTP_COOKIE_VARS["rememberCookieUname"];
$rememberCookiePassword = @$HTTP_COOKIE_VARS["rememberCookiePassword"];
// the security header which should be included in al memberpaga's
// first we include the configuration file which contains the database data
// also it will connect to the database.
include("config.php");
// tell we want to work with sessions
session_start();
// the $HTTP_SESSION_VARS[id] in this query indicates that we want to retrieve the username from the session.
$query "Select * from ".$DBprefix."signup where username='".@$HTTP_SESSION_VARS[id]."' And password = '".@$HTTP_SESSION_VARS[pass]."'";
$result mysql_query($query); 
// if there are results check it the accesslevel is high enough. If there aren't results tell the user to log-in and stop (die) after that.
if ($row mysql_fetch_array($result)){ 
// set the current level into a variable for use on a page.
$user_current_level $row["userlevel"];
// check if the user's access level is higher than zero. since if it is lower than zero he is an admin which have access to al pages.
// and check if the user's level is high enough for this page.
if ($reqlevel == && $row["userlevel"] > 0){
die(
"You need to be an admin for this page");
}else{
if (
$row["userlevel"] < $reqlevel && $row["userlevel"] > 0){
// it seems that the user's access level isn't high enough. Therefore 'die' (stop processing the page) with that message that the access level isn't high enough.
die("Your acces level is not high enough for this page, <BR> Your access level: $row[userlevel] <BR>Level required: $reqlevel");
}
}
}else{
// if there are no results, check for an cookie
if ($rememberCookiePassword != "" && $rememberCookieUname != ""){
// validate the cookie
$query "Select * from ".$DBprefix."signup where username='".$rememberCookieUname."'";
$result mysql_query($query); 
// if there are results check it the accesslevel is high enough. If there aren't results tell the user to log-in and stop (die) after that.
if ($row mysql_fetch_array($result)){ 
// check the password
if (md5($row["password"]) == $rememberCookiePassword){
// if the user has a valid cookie, set the session vars:
// remove al the data from the session (auto logoff)
session_unset();
// remove the session itself
session_destroy();
// put the password in the session
session_register("pass");
$HTTP_SESSION_VARS["pass"] = $rememberCookiePassword;
// put the username in the session
session_register("id");
$HTTP_SESSION_VARS["id"] = $rememberCookieUname;
//set the current level into a variable for use on a page.
$user_current_level $row["userlevel"];
//check if the user's access level is higher than zero. since if it is lower than zero he is an admin which have access to al pages.
//and check if the user's level is high enough for this page.
if ($reqlevel == && $row["userlevel"] > 0){
die(
"You need to be an admin for this page");
}else{
if (
$row["userlevel"] < $reqlevel && $row["userlevel"] > 0){
//it seems that the user's access level isn't high enough. Therefore 'die' (stop processing the page) with that message that the access level isn't high enough.
die("Your acces level is not high enough for this page, <BR> Your access level: $row[userlevel] <BR>Level required: $reqlevel");
}
}
}else{die(
"Please log-in, ****er.");}
}else{die(
"Please log-in, *******.");} 
}else{die(
'
<?PHP
$username1 = @$HTTP_POST_VARS["username"];
$password1 = @$HTTP_POST_VARS["password"];
$rememberMe = @$HTTP_POST_VARS["rememberMe"];
if ($rememberMe == "rememberMe"){
$rememberMe = "1";
}else{
$rememberMe = "0";
}
include("config.php");
$query = "Select * from ".$DBprefix."signup where username='
$username1'";
$result = mysql_query($query); 
if ($row = mysql_fetch_array($result)){ 
if ($row["actnum"] == "0"){
if ($row["numloginfail"] <= 5){
if ($row["password"] == $password1){
$datetime = date("d-m-Y G:i ");
$query = "UPDATE ".$DBprefix."signup Set lastlogin = '
$datetime' where username='$username1'"; 
$result = mysql_query($query); 
$query = "UPDATE ".$DBprefix."signup Set numloginfail = '
0' where username='$username1'"; 
$result = mysql_query($query); 
session_start();
session_unset();
session_destroy();
@ session_register("pass");
$HTTP_SESSION_VARS["pass"] = $password1;
@ session_register("id");
$HTTP_SESSION_VARS["id"] = $username1;
if($rememberMe=="1"){
setcookie("rememberCookieUname",$username1,(time()+604800));
setcookie("rememberCookiePassword",md5($password1),(time()+604800));
}
header("Location: members.php");
}
else{
$datetime = date("d")*10000000000 + date("m")*100000000 + date("Y")*10000 + date("G")*100 + date("i");
if ($row["lastloginfail"] >= ($datetime-5)){
$query = "UPDATE ".$DBprefix."signup Set numloginfail = numloginfail + 1 where username='
$username1'"; 
$result = mysql_query($query); 
$query = "UPDATE ".$DBprefix."signup Set lastloginfail = '
$datetime' where username='$username1'"; 
$result = mysql_query($query); 
}
else{
$query = "UPDATE ".$DBprefix."signup Set lastloginfail = '
$datetime' where username='$username1'"; 
$result = mysql_query($query); 
}
makeform($incorrectLogin);}
}
else {
$datetime = date("d")*10000000000 + date("m")*100000000 + date("Y")*10000 + date("G")*100 + date("i");
if ($row["lastloginfail"] <= ($datetime-30)){
$query = "UPDATE ".$DBprefix."signup Set numloginfail = '
5' where username='$username1'"; 
$result = mysql_query($query); 
makeform($underAttackReLogin, "$username1");
}
else{
echo $underAttackPleaseWait;
}
}
}
else{
makeform($accountNotActivated);
}
}
else{
if ($username1 == ""){ 
makeform("");
}
else {
makeform($incorrectLogin);
}
}
function makeform($errormessage="", $username2 = ""){
?>
<html>
<head>
<title>Destroi.com</title>
<style type="text/css">
<!--
.style1 {color: #5c7889}
.style2 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style3 {
color: #5c7889;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: x-small;
}
.style4 {font-size: xx-small}
.style5 {font-size: x-small}
.style7 {
color: #B5CFD5;
font-size: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style10 {color: #B5CFD5}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body bgcolor="#B5CFD5" text="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="651" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr> 
<td height="128" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/banner_w650_h168.jpg">
<!--DWLayoutTable-->
<tr>
<td width="28" height="24">&nbsp;</td>
<td width="120">&nbsp;</td>
<td width="502">&nbsp;</td>
</tr>
<tr>
<td height="92">&nbsp;</td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="120" height="40" valign="top"><form name="form1" method="post" action="">
<label><span class="style7">Username
</span>
<input name="username" type="text" id="username" value="<?PHP
echo "\"$username2\"";
if ($username2 != ""){echo "DISABLED";}
?>" size="16" maxlength="15">
<span class="style7">Password </span>
<input name="password" type="password" id="password" size="16" maxlength="15">
<br>
<input type="submit" name="Submit" value="Submit">
</label>
</form> </td>
</tr>
 
</table></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="12"></td>
<td></td>
<td></td>
</tr>
 
 
 
 
 
 
 
 
 
 
</table></td>
<td width="1"></td>
</tr>
<tr>
<td width="171" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/menu_w171_h273.jpg">
<!--DWLayoutTable-->
<tr>
<td width="33" height="25">&nbsp;</td>
<td width="109">&nbsp;</td>
<td width="29">&nbsp;</td>
</tr>
<tr>
<td height="224">&nbsp;</td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="109" height="156" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="200">
<param name="movie" value="menu.swf">
<param name="quality" value="high">
<embed src="menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="200"></embed>
</object></td>
</tr>
<tr>
<td height="24">&nbsp;</td>
</tr>
 
 
 
 
 
 
 
 
 
</table></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="24">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
 
 
 
</table></td>
<td width="479" height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/top_w479_h22.jpg">
<!--DWLayoutTable-->
<tr>
<td width="479" height="22">&nbsp;</td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/content_w479_h251.jpg">
<!--DWLayoutTable-->
<tr>
<td width="15" height="251">&nbsp;</td>
<td width="425" valign="top"><p class="style1"><span class="style2"><span class="style4"><span class="style5"><strong><?PHP 
if ($errormessage != ""){echo "<font color=\"#FF0000\"><strong>$errormessage</strong></font><br>";} ?>Lorem ipsum</strong> <em>dolor sit amet</em>, consectetuer adipiscing elit. Etiam ullamcorper tempor elit. Donec odio. Proin vitae dolor vitae dolor placerat dignissim. Donec in mi. Nulla sit amet pede. Curabitur sed est. Mauris at metus. Morbi feugiat lacus eu turpis. Nunc ultricies posuere urna. Aenean mi urna, facilisis eu, sodales vel, tincidunt placerat, sem. </span></span></span></p>
<p class="style3">Phasellus tincidunt diam vel turpis. Vestibulum pretium accumsan sem. Pellentesque lacinia nisl a lorem. Nam accumsan, nisl id congue rhoncus, justo velit rhoncus tortor, id malesuada orci augue sit amet massa. Proin tellus pede, viverra sed, lacinia vel, scelerisque id, nunc. Aenean libero. Suspendisse sed metus. Etiam rhoncus odio at arcu. Quisque iaculis lacus quis dui semper rhoncus. Morbi volutpat. Curabitur cursus. Fusce auctor ligula gravida tortor. Fusce at mi. Aenean eget metus. Integer porta nulla id felis. Sed quis massa. </p>
<p class="style3">Vivamus luctus quam sit amet ligula. Sed vitae ipsum in libero egestas aliquam. Morbi quis ante. Nullam odio. Ut eu purus. Duis enim velit, scelerisque a, egestas at, pharetra sed, orci. Phasellus vestibulum massa id lorem. Nulla mi risus, posuere ullamcorper, mollis quis, ullamcorper ac, sapien. Aenean quam libero, venenatis sed, molestie auctor, lobortis eget, velit. Integer gravida rutrum elit. Sed sed nulla tempus orci tristique mollis. Quisque tincidunt mollis elit. Aenean quis ante in lorem pulvinar sodales. Vivamus sodales. </p>
<p class="style3">Nulla facilisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce quis est. Aenean rhoncus nonummy tortor. Nam enim libero, vulputate vulputate, ornare congue, egestas nec, lectus. Nullam vitae orci quis metus molestie iaculis. Nunc ac pede ac quam placerat faucibus. Cras pharetra porta nisi. Integer egestas fermentum sapien. In tempus, justo eget consequat blandit, tortor sapien porttitor dui, vel dignissim mi nisl non leo. Morbi molestie. </p>
<p><span class="style3">Nulla molestie massa eget erat. Sed interdum est ac urna. Proin rhoncus justo nec nibh. In hac habitasse platea dictumst. Sed auctor, libero ac sagittis pulvinar, eros diam rutrum mi, quis rutrum felis sapien eget massa. Pellentesque justo sem, varius ut, pharetra fermentum, bibendum placerat, nisi. Mauris dictum, dui vitae molestie mollis, lorem risus aliquet magna, in aliquam purus nunc eu neque. Ut justo tortor, vehicula vitae, tincidunt vel, congue ut, metus. Vivamus porttitor est sed erat. Cras hendrerit. Nullam faucibus. </span><br>
</p></td>
<td width="39">&nbsp;</td>
</tr>
<tr>
<td height="14"></td>
<td valign="top"><div align="center" class="style10"><font face="Verdana" size="1">&copy; Copyright 2006 Jeff Dunn. All rights reserved. </font></div></td>
<td></td>
</tr>
 
 
 
</table></td>
<td height="251"></td>
</tr>
 
<tr>
<td height="495">&nbsp;</td>
<td></td>
</tr>
<tr>
<td height="24" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/bottom_w650_h24.jpg">
<!--DWLayoutTable-->
<tr>
<td width="650" height="24">&nbsp;</td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td height="722">&nbsp;</td>
<td>&nbsp;</td>
<td></td>
</tr>
</table>
</body>
</html>
<?php } ?>
'
);}
}
// Below we set al variables which can be used in pages, things like the current logged user and his or hers level
// This will set the user_currently_loged variable
// first we remove the htmlcode from the username saved in a cookie
$user_currently_loged htmlspecialchars($HTTP_SESSION_VARS["id"],ENT_NOQUOTES);
// Then we replace \" with "
$user_currently_loged str_replace ('\"'"&quot;"$user_currently_loged);
$user_currently_loged str_replace ("\'""&#039"$user_currently_loged);
// and a variable where u get the plain username (only use for scripting!)
$user_currently_loged_plain = @$HTTP_SESSION_VARS["id"];
if (
$user_current_level 0){
$user_current_Rank "ADMIN";}
else{
$user_current_Rank = @$ranks[$user_current_level];
}
// check if there are unread messages
$query "Select * from ".$DBprefix."inbox where adres='".@$HTTP_SESSION_VARS[id]."' And isRead = '0'";
$result mysql_query($query); 
$user_current_ammount_new = @mysql_num_rows($result); 
?>
<html>
<head>
<title>Destroi.com</title>
<style type="text/css">
<!--
.style1 {color: #5c7889}
.style2 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style3 {
color: #5c7889;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: x-small;
}
.style4 {font-size: xx-small}
.style5 {font-size: x-small}
.style10 {color: #B5CFD5}
.style11 {
color: #5c7889;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
}
.style14 {font-size: 12px}
-->
</style>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<body bgcolor="#B5CFD5" text="#FFFFFF" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="651" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr> 
<td height="128" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/banner_w650_h168.jpg">
<!--DWLayoutTable-->
<tr>
<td width="29" height="24">&nbsp;</td>
<td width="120">&nbsp;</td>
<td width="501">&nbsp;</td>
</tr>
<tr>
<td height="92"></td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="120" height="92" valign="top"><p class="style11"><span class="style14"><strong>Welcome,</strong><br>
<br>
$user!<br>
<br>
Click <em>here</em> for the members section.
</span><br>
<br>
<br>
</p>
<p class="style11">&nbsp;</p></td>
</tr>
 
</table></td>
<td></td>
</tr>
<tr>
<td height="12"></td>
<td></td>
<td></td>
</tr>
 
 
 
 
 
 
 
 
 
 
 
 
</table></td>
<td width="1"></td>
</tr>
<tr>
<td width="171" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/menu_w171_h273.jpg">
<!--DWLayoutTable-->
<tr>
<td width="33" height="25">&nbsp;</td>
<td width="109">&nbsp;</td>
<td width="29">&nbsp;</td>
</tr>
<tr>
<td height="224">&nbsp;</td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="109" height="156" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="100" height="200">
<param name="movie" value="menu.swf">
<param name="quality" value="high">
<embed src="menu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="200"></embed>
</object></td>
</tr>
<tr>
<td height="24">&nbsp;</td>
</tr>
 
 
 
 
 
 
 
 
 
</table></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="24">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
 
 
 
</table></td>
<td width="479" height="22" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/top_w479_h22.jpg">
<!--DWLayoutTable-->
<tr>
<td width="479" height="22">&nbsp;</td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/content_w479_h251.jpg">
<!--DWLayoutTable-->
<tr>
<td width="15" height="251">&nbsp;</td>
<td width="425" valign="top"><p class="style1"><span class="style2"><span class="style4"><span class="style5"><strong>Lorem ipsum</strong> <em>dolor sit amet</em>, consectetuer adipiscing elit. Etiam ullamcorper tempor elit. Donec odio. Proin vitae dolor vitae dolor placerat dignissim. Donec in mi. Nulla sit amet pede. Curabitur sed est. Mauris at metus. Morbi feugiat lacus eu turpis. Nunc ultricies posuere urna. Aenean mi urna, facilisis eu, sodales vel, tincidunt placerat, sem. </span></span></span></p>
<p class="style3">Phasellus tincidunt diam vel turpis. Vestibulum pretium accumsan sem. Pellentesque lacinia nisl a lorem. Nam accumsan, nisl id congue rhoncus, justo velit rhoncus tortor, id malesuada orci augue sit amet massa. Proin tellus pede, viverra sed, lacinia vel, scelerisque id, nunc. Aenean libero. Suspendisse sed metus. Etiam rhoncus odio at arcu. Quisque iaculis lacus quis dui semper rhoncus. Morbi volutpat. Curabitur cursus. Fusce auctor ligula gravida tortor. Fusce at mi. Aenean eget metus. Integer porta nulla id felis. Sed quis massa. </p>
<p class="style3">Vivamus luctus quam sit amet ligula. Sed vitae ipsum in libero egestas aliquam. Morbi quis ante. Nullam odio. Ut eu purus. Duis enim velit, scelerisque a, egestas at, pharetra sed, orci. Phasellus vestibulum massa id lorem. Nulla mi risus, posuere ullamcorper, mollis quis, ullamcorper ac, sapien. Aenean quam libero, venenatis sed, molestie auctor, lobortis eget, velit. Integer gravida rutrum elit. Sed sed nulla tempus orci tristique mollis. Quisque tincidunt mollis elit. Aenean quis ante in lorem pulvinar sodales. Vivamus sodales. </p>
<p class="style3">Nulla facilisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce quis est. Aenean rhoncus nonummy tortor. Nam enim libero, vulputate vulputate, ornare congue, egestas nec, lectus. Nullam vitae orci quis metus molestie iaculis. Nunc ac pede ac quam placerat faucibus. Cras pharetra porta nisi. Integer egestas fermentum sapien. In tempus, justo eget consequat blandit, tortor sapien porttitor dui, vel dignissim mi nisl non leo. Morbi molestie. </p>
<p><span class="style3">Nulla molestie massa eget erat. Sed interdum est ac urna. Proin rhoncus justo nec nibh. In hac habitasse platea dictumst. Sed auctor, libero ac sagittis pulvinar, eros diam rutrum mi, quis rutrum felis sapien eget massa. Pellentesque justo sem, varius ut, pharetra fermentum, bibendum placerat, nisi. Mauris dictum, dui vitae molestie mollis, lorem risus aliquet magna, in aliquam purus nunc eu neque. Ut justo tortor, vehicula vitae, tincidunt vel, congue ut, metus. Vivamus porttitor est sed erat. Cras hendrerit. Nullam faucibus. </span><br>
</p></td>
<td width="39">&nbsp;</td>
</tr>
<tr>
<td height="14"></td>
<td valign="top"><div align="center" class="style10"><font face="Verdana" size="1">&copy; Copyright 2006 Jeff Dunn. All rights reserved. </font></div></td>
<td></td>
</tr>
 
 
 
</table></td>
<td height="251"></td>
</tr>
 
<tr>
<td height="495">&nbsp;</td>
<td></td>
</tr>
<tr>
<td height="24" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="http://www.destroi.com/images/addapta/bottom_w650_h24.jpg">
<!--DWLayoutTable-->
<tr>
<td width="650" height="24">&nbsp;</td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td height="722">&nbsp;</td>
<td>&nbsp;</td>
<td></td>
</tr>
</table>
</body>
</html>
Here's line 77, I added the >>

PHP Code:
include("config.php");
>> 
$query "Select * from ".$DBprefix."signup where username='$username1'";
$result mysql_query($query); 
if (
$row mysql_fetch_array($result)){ 
Please help.
destroi is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-22-2006, 03:46 PM Re: Unexpected T_VARIABLE
Novice Talker

Posts: 6
Trades: 0
I always find the answer to these questions by copying the code, then pasting it into the SQL window of phpMyAdmin.

Of course, when you paste it in, make sure you substitue proper varibales. Also, place an echo statement right below line 77, that says (minus brackets) [echo "The sql string is $query". See if it makes sense.

Good luck.
dougp25 is offline
Reply With Quote
View Public Profile
 
Old 04-22-2006, 05:05 PM Re: Unexpected T_VARIABLE
mad_willsy's Avatar
Super Spam Talker

Latest Blog Post:
R&R Catering Hire Testimonial
Posts: 805
Name: Will Craig
Location: Cheltenham, Gloucestershire, UK
Trades: 0
are you sure that
Quote:
include("config.php");
actually has a ; on the end. i normally find that to be the error
__________________
Wont :P

Please login or register to view this content. Registration is FREE
mad_willsy is offline
Reply With Quote
View Public Profile Visit mad_willsy's homepage!
 
Old 04-22-2006, 05:50 PM Re: Unexpected T_VARIABLE
Experienced Talker

Posts: 40
Location: Denmark
Trades: 0
The problem isnt at that line.. Let me show a few lines of the code (around 60-70):

PHP Code:
}else{die("Please log-in, ****er.");}
}else{die("Please log-in, *******.");} 
}else{die('
<?PHP
$username1 
= @$HTTP_POST_VARS["username"];
$password1 = @$HTTP_POST_VARS["password"];
$rememberMe = @$HTTP_POST_VARS["rememberMe"];
That last die seems very wrong. The die(' is not terminated (no matching "'", nor "); }").. And then a <?PHP while inside a php-block. Try to look closer at these lines.
dennismp is offline
Reply With Quote
View Public Profile Visit dennismp's homepage!
 
Old 04-22-2006, 07:25 PM Re: Unexpected T_VARIABLE
mad_willsy's Avatar
Super Spam Talker

Latest Blog Post:
R&R Catering Hire Testimonial
Posts: 805
Name: Will Craig
Location: Cheltenham, Gloucestershire, UK
Trades: 0
its because you have 3 else's. You need elseif, elseif, else
__________________
Wont :P

Please login or register to view this content. Registration is FREE
mad_willsy is offline
Reply With Quote
View Public Profile Visit mad_willsy's homepage!
 
Old 04-22-2006, 10:56 PM Re: Unexpected T_VARIABLE
Average Talker

Posts: 15
Trades: 0
I'm sorry to say, but all of the above are wrong:

include("config.php"); << I always put a semi colon.
');}
} <<
I closed my brackets at the end of the HTML page

the elses work fine when I die out with text or HTML, it's when I add the PHP that this problem occurs.
destroi is offline
Reply With Quote
View Public Profile
 
Old 04-23-2006, 06:35 AM Re: Unexpected T_VARIABLE
Experienced Talker

Posts: 40
Location: Denmark
Trades: 0
Well, consider it again. I'm sure its incorrect as it leads to a syntax errors (and semantics errors). Even the PHP-syntax-highlighter messes up.

"}else{die('" .. here you starts a string with single-quote .. and it is terminated in the line:
"$query = "Select * from ".$DBprefix."signup where username='

Im pretty sure you dont want to terminate that string there.

And die() does not parse php-code, so
die('<?php print "stuff";%>') Will not print "stuff", but <?php print "stuff";%>.

Again look closer at those lines. Consider simplifying your code, use more files, functions or whatever works for you.
dennismp is offline
Reply With Quote
View Public Profile Visit dennismp's homepage!
 
Reply     « Reply to Unexpected T_VARIABLE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.87480 seconds with 12 queries