MySQL Forums
Forum List  »  Perl

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
November 13, 2008 11:58AM
November 13, 2008 02:07PM
November 14, 2008 05:37AM


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

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.