Eroare unexpected T_STRING
Scris: Mie Dec 28, 2011
Am facut un sistem de register + login , de inregistrat mi se inregistreaza dar la login imi apare eroarea :
Sistemul este unul cu inregistrare in html + php .
Eroarea de la linia 19 este :
Iar tot login.php :
Cod: Selectaţi tot
Parse error: syntax error, unexpected T_STRING in /home/hosting/nume/domeniu.ro/login.php on line 19
Eroarea de la linia 19 este :
Cod: Selectaţi tot
$query = “select * from users where username=’$username’ and password=’$password’”;
Cod: Selectaţi tot
<?php
//Database Information
$dbhost = "localhost";
$dbname = "your database name";
$dbuser = "username";
$dbpass = "yourpass";
//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 “membri.php”;
}
?>