FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


login system error? can't figure it out





jspets
hi

i have another question when i try to do a test login. I think its the same error i got when i tried to do a test register. Could someone try and sort it out i think its somehting to do with the apostrophe things.

this is the error:
Parse error: syntax error, unexpected T_STRING in /usr/home/jspets/domains/petknowledge.frih.org/public_html/login.php on line 13

this is my login.php

Code:
<?php
//Database Information
$dbhost = "localhost";
$dbname = "";
$dbuser = "";
$dbpass = "";
//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”;
}
?>


I have taken out the database info for security.
Could someone post it correctly Very Happy
Thanks Very Happy
Peterssidan
On line 13
Code:
... username="'$username’ ...

The " after username= is not right. I think you should remove it.
rvec
oh please start using ' and " instead of those ` things (or anything else). They screw up the whole script.
mathiaus
Sorted out through PM.



rvec wrote:
oh please start using ' and " instead of those ` things (or anything else). They screw up the whole script.

I think jspets is using Word? Suggested a different editor through PM as well to avoid those sort of problems.
albuferque
Yes, use textpad:

www.textpad.com

Also check your keyboard layout
Related topics
html login system
Simple login system
Site Members' System
Detected SPYware! System error #384
Login System help
Developing a Login System with PHP and MySQL
i need a single user login system
Login System Tutorial Part 1 Creating Registration
Problem with Member system(or template) and $_GET[id]
Frih$ on offer for PHP Login System
Could someone create a really simple login system???
login and register system error
Login system with uploading features!
Creating safe persistent login system
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.