| | |
Please Help! parse error, unexpected T_STRING
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2006
Posts: 1
Reputation:
Solved Threads: 0
[PHP]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login Processing...</title>
</head>
<body>
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if( $username != null or $password !=null)
{
$conn = @mysql_connect("localhost", "uesrname", "pass") or die("could not connect");
$rs = @mysql_select_db( "siqq_web", $conn ) or die("could not select database");
$sql = "SELECT * from basicinfo where username=\"$username\" and password = password( \"$password\" );
$rs = @mysql_query( $sql, $conn ) or die("could not execute");
$num = mysql_numrows( $rs );
if( $num != 0 )
{
echo( "welcome" );
}
else
{
echo( "no" );
}
}
else
{
echo( "something went wrong." );
}
?>
</body>
</html>[/PHP]
I keep getting "Parse error: parse error, unexpected T_STRING in /home/siqq/public_html/test/login.php on line 18"
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Login Processing...</title>
</head>
<body>
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if( $username != null or $password !=null)
{
$conn = @mysql_connect("localhost", "uesrname", "pass") or die("could not connect");
$rs = @mysql_select_db( "siqq_web", $conn ) or die("could not select database");
$sql = "SELECT * from basicinfo where username=\"$username\" and password = password( \"$password\" );
$rs = @mysql_query( $sql, $conn ) or die("could not execute");
$num = mysql_numrows( $rs );
if( $num != 0 )
{
echo( "welcome" );
}
else
{
echo( "no" );
}
}
else
{
echo( "something went wrong." );
}
?>
</body>
</html>[/PHP]
I keep getting "Parse error: parse error, unexpected T_STRING in /home/siqq/public_html/test/login.php on line 18"
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
Thanks for using [ code ] tags.
If you use an editor with color highlighting, it can sometimes help you catch an error such as this. Notice how the text is all red until it hits the quote on the next line?
If you use an editor with color highlighting, it can sometimes help you catch an error such as this. Notice how the text is all red until it hits the quote on the next line?
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Its solved: Let see now!
<?php
//$username = $_POST['username'];
//$password = $_POST['password'];
$username = "user";
$password = "password";
if( $username != null or $password !=null){ // If 1
$conn = @mysql_connect("localhost", "username", "password") or die("could not connect");
$rs = @mysql_select_db( "test", $conn ) or die("could not select database");
$sql = "SELECT * from basicinfo where username=('$username') and password = password( '$password' )"; // Here was problem
$rs = @mysql_query($sql, $conn) or die("could not execute");
$num = mysql_numrows( $rs );
} else {
if ($num != 0){ // If 2
echo( "welcome" );
} elseif ($num <= 0 || $num = null){ // in If 2
echo("no");
} else { // in If 2
echo( "something went wrong." );
} // end if 2
} // end if 1
?>
My Files Here: http://www.geocities.com/waytosuccess4it/index.html
<?php
//$username = $_POST['username'];
//$password = $_POST['password'];
$username = "user";
$password = "password";
if( $username != null or $password !=null){ // If 1
$conn = @mysql_connect("localhost", "username", "password") or die("could not connect");
$rs = @mysql_select_db( "test", $conn ) or die("could not select database");
$sql = "SELECT * from basicinfo where username=('$username') and password = password( '$password' )"; // Here was problem
$rs = @mysql_query($sql, $conn) or die("could not execute");
$num = mysql_numrows( $rs );
} else {
if ($num != 0){ // If 2
echo( "welcome" );
} elseif ($num <= 0 || $num = null){ // in If 2
echo("no");
} else { // in If 2
echo( "something went wrong." );
} // end if 2
} // end if 1
?>
My Files Here: http://www.geocities.com/waytosuccess4it/index.html
Last edited by blacksmoke; Aug 21st, 2006 at 12:36 am. Reason: Smoe codes was missing!
![]() |
Similar Threads
- parse error, unexpected T_STRING in (PHP)
- Parse error: parse error, unexpected T_STRING on line 12 (PHP)
- Parse Error T_STRING - Help Please (PHP)
- Parse error: parse error, unexpected T_STRING (PHP)
- PHP Parse error: parse error, unexpected T_STRING (PHP)
- Parse error: parse error, unexpected T_STRING in /home/thei2k9/public_html/includes/f (PHP)
- Need Help With Parse Error... (PHP)
Other Threads in the PHP Forum
- Previous Thread: How to pre-select checkboxes in form?
- Next Thread: Calling a PHP function from HTML menu
| Thread Tools | Search this Thread |
.htaccess alexa apache api array beginner beneath binary broadband broken cakephp checkbox class cms code convert cron curl database date display dynamic echo email encode error explodefunction fcc file files folder form forms function functions google howtowriteathesis href htaccess html image images include insert ip javascript joomla key keywords limit link login mail mail() memberships menu mlm multiple multipletables mysql mysql_real_escape_string network oop open passwords paypal pdf php provider query radio random redirect remote rss script search securephp server sessions smtp source space sql strip_tags syntax system table template tutorial update upload url user validator variable video voteup web youtube





