Go Back   ClanTemplates > Professional > Programming
Game Tracker

Programming Got something programming related you wanna talk about? Post it here. PHP, ASP, CGI, MySQL, etc.

Reply
  Thread Tools Display Modes
#1  
Old February 2nd, 2007, 07:30 AM
Sanesh. Sanesh. is offline
Iownyourmon
 
Join Date: Oct 2004
iTrader: (0)
Posts: 5,969
Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute
Send a message via MSN to Sanesh.
[PHP] Parse error

I have already tried google none of the solutions worked!

Hi, need some php help buddies!

When trying to run my script I get the following error.

Quote:
Parse error: parse error, unexpected $ in /home/auth.php on line 37
Heres my script:

PHP Code
			
<?php

if(!$_POST['submit']){
    die(
"Hacking attempt");
};

if (!
$username || !password ) {
    if ( 
strlen($username) == 0) {
        echo 
"There is no username entered. <br />";
        };
    if ( 
strlen($password) == 0) {
        echo 
"There is no password entered. <br />";
        };
    exit; 
} else {

$enpass md5($password);

include(
'config.php');
$db mysql_connect('localhost'$dbusername$dbpassword);
    if (!
$db) {
           echo 
'Could not connect to MySQL server <br />';
           exit;
    };
    
@
mysql_select_db($dbname) or die( "Unable to select database");
$query "SELECT * FROM $login_table WHERE username = '$username'";
$result mysql_query($query); 
$row mysql_fetch_assoc($result); 

if(
$password == $row[password]) {
    echo 
"Welcome $row[username] you are now logged in.";
    
$_SESSION['login'] = $row[priv];
    } else {
        echo 
"Your username or password were incorrect. Please try again.";
};
?>
However line 37 is the end of the script just the ?>. I have check the script for missing ';' and any left over brackets and its all fine. I would appreciate any help.

Thanks in advance.
__________________
* tweet *

Private Message inbox is full, email "opserty" followed by an at and a "gmail" and a dot and a "com" to contact me. =]


Sanesh. says (22:54): We need to think up a PHPWomen chatup line
Kalle Almighty says (22:54): lol
Sanesh. says (22:55): how about "I tried to use the imagecreatefromyou() function on you, but the Parser returned a T_TOO_SEXY error" ?



Last edited by Sanesh. : April 4th, 2005 at 09:13 PM
Reply With Quote
#2  
Old February 2nd, 2007, 07:30 AM
pinkegobox- pinkegobox- is offline
CT Hobo
 
Join Date: Jan 2005
From: Leeds, England
iTrader: (0)
Posts: 185
pinkegobox- is an unknown quantity at this point
Send a message via ICQ to pinkegobox- Send a message via AIM to pinkegobox- Send a message via MSN to pinkegobox-
Re: [PHP] Parse error

that''s hapened to me before i juyst simply scrapped the cript

try it without the end ?> tag just out of interest.
__________________
PHP Code
			
<?php 
  
if(JavaScript == PHP)
   { echo(
'What is the world coming to'); }
?>
Reply With Quote
#3  
Old February 2nd, 2007, 07:30 AM
pinkegobox- pinkegobox- is offline
CT Hobo
 
Join Date: Jan 2005
From: Leeds, England
iTrader: (0)
Posts: 185
pinkegobox- is an unknown quantity at this point
Send a message via ICQ to pinkegobox- Send a message via AIM to pinkegobox- Send a message via MSN to pinkegobox-
Re: [PHP] Parse error

also im not sure there should be a ";" before the end tag ?>
__________________
PHP Code
			
<?php 
  
if(JavaScript == PHP)
   { echo(
'What is the world coming to'); }
?>
Reply With Quote
#4  
Old February 2nd, 2007, 07:30 AM
Sanesh. Sanesh. is offline
Iownyourmon
 
Join Date: Oct 2004
iTrader: (0)
Posts: 5,969
Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute
Send a message via MSN to Sanesh.
Re: [PHP] Parse error

Tried both with no luck. Thanks anyway.
__________________
* tweet *

Private Message inbox is full, email "opserty" followed by an at and a "gmail" and a dot and a "com" to contact me. =]


Sanesh. says (22:54): We need to think up a PHPWomen chatup line
Kalle Almighty says (22:54): lol
Sanesh. says (22:55): how about "I tried to use the imagecreatefromyou() function on you, but the Parser returned a T_TOO_SEXY error" ?


Reply With Quote
#5  
Old February 2nd, 2007, 07:30 AM
Sanesh. Sanesh. is offline
Iownyourmon
 
Join Date: Oct 2004
iTrader: (0)
Posts: 5,969
Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute
Send a message via MSN to Sanesh.
Re: [PHP] Parse error

Problem solved!!!
__________________
* tweet *

Private Message inbox is full, email "opserty" followed by an at and a "gmail" and a dot and a "com" to contact me. =]


Sanesh. says (22:54): We need to think up a PHPWomen chatup line
Kalle Almighty says (22:54): lol
Sanesh. says (22:55): how about "I tried to use the imagecreatefromyou() function on you, but the Parser returned a T_TOO_SEXY error" ?


Reply With Quote
#6  
Old February 2nd, 2007, 07:30 AM
auveeb auveeb is offline
Head Ilama
 
Join Date: Aug 2004
From: Queens, NY {HACK}
iTrader: (0)
Posts: 2,505
auveeb has a reputation beyond repute
Re: [PHP] Parse error

What'd you do to solve it?
__________________
http://www.accesscassie.com
Reply With Quote
#7  
Old February 2nd, 2007, 07:30 AM
Sanesh. Sanesh. is offline
Iownyourmon
 
Join Date: Oct 2004
iTrader: (0)
Posts: 5,969
Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute Sanesh. has a reputation beyond repute
Send a message via MSN to Sanesh.
Re: [PHP] Parse error

I messed up the indenting so forgot a '}' tag somehow slipped passed me.
__________________
* tweet *

Private Message inbox is full, email "opserty" followed by an at and a "gmail" and a dot and a "com" to contact me. =]


Sanesh. says (22:54): We need to think up a PHPWomen chatup line
Kalle Almighty says (22:54): lol
Sanesh. says (22:55): how about "I tried to use the imagecreatefromyou() function on you, but the Parser returned a T_TOO_SEXY error" ?


Reply With Quote
Reply

Warning
You are about to reply to a thread, where the last post is over 2 weeks old. Replying without a constructive post related to the topic, will result in infractions being given out

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



All times are GMT +1. The time now is 11:46 AM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.