Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I get this error code when I run the code below: Parse error: syntax error, unexpected T_STRING in /home/a7120106/public_html/checklogin.php on line 3


PHP
include("dbconfig/dbconfig.php")
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name");
$myusername=$_POST['myusername'];
$mypassword=$_POST['mypassword'];
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1){
session_register("myusername");
session_register("mypassword");
header("location:http://www.pixidian.net/");
}
else {
echo "Wrong Username or Password";
}

and dbconfig contains this:
PHP
$host="mysql15.000webhost.com";
$db_name="a7120106_*****";
$username="a7120106_*****";
$password="*****";
$tbl_name="members";
Posted
Updated 29-Jul-11 23:30pm
v3

Seriously? after a day no one has ansered this?
 
Share this answer
 
You're missing a semi-colon (;) in the include line

It should be,
PHP
include("dbconfig/dbconfig.php");


instead of,
PHP
include("dbconfig/dbconfig.php")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900