|
Author |
Message |
PunkGo
Junior WebHelper
Joined: 06 Aug 2003
Posts: 1
|
Posted:
Wed Aug 06, 2003 11:46 pm (20 years, 8 months ago) |
|
Hey, I dunno what's wrong, but here's what the error says:
Code: | Parse error: parse error, unexpected '{' in c:\appserv\www\login.php on line 17 |
Here's my PHP:
Code: | if ($submit = "Login")
{
mysql_connect("JOEYOWNZ", "punkgo", "********") or
die ("Could not connect to database");
mysql_select_db("users") or
dir ("Could not select database");
$_REQUEST=mysql_query("select * from user where username='" . $username . "'")
or die ("cant do it");
while ($row=mysql_fetch_array($_REQUEST)) {
if ( isset( $_POST[ 'password' ] )
{
printf("Successfully Logged In!");
}else{
print("Nope");
}
}
}
?> |
|
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Thu Aug 07, 2003 7:17 am (20 years, 8 months ago) |
|
Couple of things highlighted below = should be ==
and dir should be die
see if that helps
Quote: | if ($submit = "Login")
{
mysql_connect("JOEYOWNZ", "punkgo", "********") or
die ("Could not connect to database");
mysql_select_db("users") or
dir ("Could not select database");
$_REQUEST = mysql_query("select * from user where username='" . $username . "'")
or die ("cant do it");
while ($row=mysql_fetch_array($_REQUEST))
{
if ( isset( $_POST[ 'password' ] )
{
printf("Successfully Logged In!");
}
else
{
print("Nope");
}
}
} |
|
|
|
|
|
adam
Forum Moderator & Developer
Joined: 26 Jul 2002
Posts: 704
Location: UK
|
Posted:
Thu Aug 07, 2003 2:22 pm (20 years, 8 months ago) |
|
in addition to what Darren said, you should correct the following:
Code: | if ( isset( $_POST[ 'password' ] ) |
should be
Code: | if ( isset( $_POST[ 'password' ] ) ) |
|
________________________________ It's turtles all the way down... |
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Thu Aug 07, 2003 2:58 pm (20 years, 8 months ago) |
|
well spotted |
|
|
|
|
jayant
Team Member
Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India
|
Posted:
Fri Aug 08, 2003 3:06 pm (20 years, 8 months ago) |
|
Code: | $_REQUEST = mysql_query("select * from user where username='" . $username . "'")
or die ("cant do it"); |
$_REQUEST is a special array. you should not change information contained in it by assigning it some other values. |
________________________________ Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.123359 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |