Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1035 | Replies: 2
![]() |
•
•
Join Date: Apr 2006
Posts: 14
Reputation:
Rep Power: 3
Solved Threads: 0
This is my code but I get the error
Parse error: parse error, unexpected T_STRING in /home/projecte/public_html/index.php on line 48
When I try it, any ideas on whats gone wrong
Parse error: parse error, unexpected T_STRING in /home/projecte/public_html/index.php on line 48
When I try it, any ideas on whats gone wrong
<?PHP
switch ($pg) {
case login:
$dbh=mysql_connect ("localhost", "projecte_ries", "*********") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("projecte_gamedb");
$_POST['email'] == $email;
$_POST['password'] == $pass;
if (!isset($_POST['email'])) {
$error == 1;
die('<center><body bgcolor=black>No email address was entered into the email field</body></center>');
}
if (!isset($_POST['password'])) {
$error == 1;
die('<center>You did not input a password in the password field</body></center>');
}
$checklog = mysql_query("SELECT user,pass FROM members WHERE `email`='$email'")or die(mysql_error());
while($checked = mysql_fetch_array($checklog)) {
if ($checked['password'] != $pass) {
$error = 1;
die('<center>You entered a incorrect password :o</center>');
}else{
echo "<meta http-equiv='Refresh' content='0;url=members.php'>";
}
}
break;
case register:
echo "<html>
<head>
<title>Red Winter</title>
</head>
<body><center><table width='600' height='200'><tr><td></tr></td></table>";
echo "<form action='index.php?pg=register2'>email:<input type='text' name='email' /><br /> pass:<input type='password' name='password' /><br /> username:<input type='text' name='user' />";
echo "<br /><input type='submit' value='Register' /></form>";
break;
case register2:
echo "<html>
<head>
<title>Red Winter</title>
</head>
<body><center><table width='600' height='200'><tr><td></tr></td></table>";
$_POST['email'] == $email;
$_POST['pass'] == $pass;
$_POST['user'] == $user;
$reg = mysql_query("SELECT * FROM members WHERE `email`='$email' ")or die(mysql_error());
@$numm = mysql_num_rows($reg);
if ($numm == "1"){
die('Someone already has an account with that email, you can't have multis');
}
$sign = mysql_query("SELECT * FROM members WHERE `user`='$user' ")or die(mysql_error());
@$sigg = mysql_num_rows($sign);
if ($sigg == "1"){
die('That username is already in use, go back and try another.');
}
$add = mysql_query("INSERT INTO members ('user','pass','email') VALUES ('$user','$pass','$email') ")or die(mysql_error());
echo "You can now login and play :D<br />";
break;
default:
$dbh=mysql_connect ("localhost", "projecte_ries", "********") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("projecte_gamedb");
$sigings = mysql_query("SELECT * FROM members")or die(mysql_error());
@$signed = mysql_num_rows($sigings);
echo "<html>
<head>
<title>Red Winter</title>
</head>
<body><center><table width='600' height='200'><tr><td></tr></td></table> ";
echo "
<style type='text/css'>
input, textarea, select {
color: white;
background: #000000;
border: solid white 1px;
}
a {
text-decoration: none;
text-transform: none;
color: white;
font-family: verdana;
font-size: 10px;
}
body {
background: #000000;
background-attachment: fixed;
background-possition: center;
font-family: verdana;
color: white;
font-size: 10px;
}
</style>
$signed people are already playing!<br />
<form action='index.php?pg=login' method='post'>
email:<input type='text' name='email' /><br />
pass: <input type='password' name='password' /><br />
<input type='submit' value='Login' /><br /><br /><br />
<a href='index.php?pg=login'>Login</a> : <a href='index.php?pg=register'>Register</a> : <a href='index.php?pg=tos'>ToS</a>";
break;
}
?>•
•
Join Date: Apr 2005
Location: Auckland, New Zealand
Posts: 136
Reputation:
Rep Power: 4
Solved Threads: 1
on this section of code
your error message has a ' in it
so change it to or
@$numm = mysql_num_rows($reg);
if ($numm == "1"){
die('Someone already has an account with that email, you can't have multis');
}so change it to
die("Someone already has an account with that email, you can't have multis");die('Someone already has an account with that email, you can\'t have multis');•
•
Join Date: Apr 2006
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
look on this line
you need to change it like
see the diffrence of comma,
you have to hide that in your code by "\"
•
•
•
•
if ($numm == "1"){
die('Someone already has an account with that email, you can't have multis');
}
you need to change it like
•
•
•
•
if ($numm == "1"){
die('Someone already has an account with that email, you can\'t have multis');
}
see the diffrence of comma,
you have to hide that in your code by "\"
Ravish Kumar
I run Loanskey ( A Loan and Mortgage infomation company) and RealEstateCut ( A real estate listing websites ) . I love both of these websites. and this is a subdomain of the loanskey for UK
I run Loanskey ( A Loan and Mortgage infomation company) and RealEstateCut ( A real estate listing websites ) . I love both of these websites. and this is a subdomain of the loanskey for UK
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode