Forum Moderators: coopster

Message Too Old, No Replies

Parse error: syntax error, unexpected T STRING

...

         

Shane54

3:25 am on Aug 15, 2008 (gmt 0)

10+ Year Member



below is my php login script i've got this error message....> "Parse error: syntax error, unexpected T_STRING in C:\apachefriends\xampp\htdocs\index.php on line 24"<...any one can help find the error on line 24. thanks in advance

1 <?php
2
3 //Database Information
4
5 $dbhost = "localhost";
6 $dbname = "login_reg_system";
7 $dbuser = "root";
8 $dbpass = "";
9
10 //Connect to database
11
12 mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
13 mysql_select_db($dbname) or die(mysql_error());
14
15 session_start();
16 $username = $_POST[‘username’];
17 $password = md5($_POST[‘password’]);
18
19 $query = "select * from users where username=’$username’ and password=’$password’";
20
21 $result = mysql_query($query);
22
23 if (mysql_num_rows($result) != 1) {
24 $error = “Bad Login”;
25 include “login.html”;
26
27} else {
28 $_SESSION[‘username’] = "$username";
29 // include “memberspage.php”;
30
31 include “registration.php”;
32
33}

MattAU

5:02 am on Aug 15, 2008 (gmt 0)

10+ Year Member



The syntax looks ok, maybe the funny quotation marks “ ” should be regular style ".

dreamcatcher

7:19 am on Aug 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it something to do with the quotes you are using? They look differently formatted to standard double quotes?

dc

eeek

9:23 pm on Aug 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



$error = “Bad Login”;

Replace the quotes with real quotes. You are using something else on that line.

g1smd

10:21 pm on Aug 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Lines 25, 29, 31 also have the same error.