Skip navigation links

MySQL Forums


Advanced Search

T_STRING
Posted by: Dan Hardy ()
Date: November 13, 2008 11:58AM

<?php



$dbhost = "localhost";
$dbname = "wyrleyjuniors";
$dbuser = "root";
$dbpass = "yourpass";



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’ & 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”;
}

?>



PLEASE HELP!!!

I can successfully register new users and they do indeed go into and save on my database. However when I try and login I get the following message:

Parse error: syntax error, unexpected T_STRING in C:\wamp\www\login.php on line 19

Any Ideas?


Cheers Dan.


Bare in mind i'm a noobie

Options: ReplyQuote


Subject Written By Posted
T_STRING Dan Hardy 11/13/2008 11:58AM
Re: T_STRING Randy Clamons 11/13/2008 02:07PM
Re: T_STRING Dan Hardy 11/14/2008 05:37AM


Sorry, you can't reply to this topic. It has been closed.