Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unexpected T_STRING!!! PLEASE HELP

Status
Not open for further replies.

johntt34

Programmer
Apr 26, 2006
1
US
im trying to make a login page and i get the message
Parse error: syntax error, unexpected T_STRING in C:\Program Files\xampp\htdocs\login\login.php on line 18

<?php

//Database Information

$dbhost = "localhost";
$dbname = "password";
$dbuser = "admin";

//Connect to database

mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());

session_start();
$username = $_POST[‘username’];
$password = md5($_POST[‘password’]);

$query = “select * from users where username=’$username’ and password=’$password’”;

$result = mysql_query($query);

if (mysql_num_rows($result) != 1) {
$error = “Bad Login”;
include “login.html”;

} else {
$_SESSION[‘username’] = “$username”;
include “memberspage.php”;
}

?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top