Reply to PHP MSSQL login script, newbee

Your name:

Reply:


Posted by Damien on 12/28/05 14:49

Ok ik heb dus het volgende script gebruikt alleen krijg ik een error
melding op regel 17 wat te maken heeft met die SQL query.

<?php
session_start();
if (!isset($_POST["submit"])) // checks wheter the page is called using
the login form
{
header("Location:login.html"); // the script sends the user to the
registration page
} else {
if ($_POST["username"] == NULL || $_POST["password"] == NULL) // check
wheter both username and password are filled
{
echo "<font color=\"red\">Not all fields were filled. Please go <a
href=\"login.html\">back</a> and fill them</font>";
} else {
include("DatabaseConfig.php");
$usernameexists = mssql_query("SELECT ID FROM tblusers WHERE
username"=.$_POST["username"]."' &&
password='".$_POST["password"]."'");

if (mssql_num_rows($usernameexists) != 0)
{
$_SESSION["mywebsite_userid"] = mssql_result($usernameexists,'',"ID");
?>
<font color="red">You are successfully logged in.</font><br>
Go to the secret page: <a href="secret.php">Secret page</a>
<?php
} else {
echo "<font color=\"red\">Wrong combination username/password. <a
href=\"login.html\">Try login again</a> or <a

href=\"register.html\">register</a></font>";
}
mssql_close();
}
}
?>

De fout zit dacht ik in deze regel:

$usernameexists = mssql_query("SELECT ID FROM tblusers WHERE
username"=.$_POST["username"]."' &&
password='".$_POST["password"]."'");

Ik weet niet meer wat ik moet doen :( Deze melding krijg ik:
Parse error: syntax error, unexpected '=' in
c:\inetpub\wwwroot\login.php on line 17

Heeft iemand tips of oplossing?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация