Jump to content

[SOLVED] Error


Ken2k7

Recommended Posts

I keep getting this error:

Parse error: syntax error, unexpected T_VARIABLE in /hosted/subs/ulmb.com/a/l/alpha/public_html/game/index.php on line 13

 

I don't know why. Here's the code:

<?php
session_start();

define("OPEN", 1);
include "config.php";
include "classes.php";

if ($_POST['submit'])
{
$_SESSION['name'] = $_POST['name'];
$_SESSION['pass'] = $_POST['pass'];
$error = "The username and password are incorrect.<br />If you are not registered, please <a href='register.php'>register</a>; otherwise, try again."
$query = mysql_query("SELECT * FROM member WHERE name='{$_SESSION['name']}'");
$row = mysql_fetch_assoc($query);
if (mysql_num_rows($query) == 0) echo "The username does not exist. Please register.";
else if ($query['name'] == $_SESSION['name'])
	if ($query['password'] == sha1($_SESSION['pass'])) header("Location: {$_SESSION['name']}");
	else echo error;
else eccho error;
}

if (isset($_SESSION['name'])) header("Location: {$_SESSION['name']}");
else
echo "<title>Coder's Alliance</title>
	<h1>Coder's Alliance Login</h1>
	<form action='$PHP_SELF' method='post'>
	Username: <input type='text' name='name' size='40' length='40'><br />
	Password: <input type='text' name='pass' size='40' length='40'><br />
	<input type='submit' name='submit' value='Submit'>
	<input type='reset' name='reset' value='Clear It'>
	</form>";
?>

Link to comment
https://forums.phpfreaks.com/topic/66619-solved-error/
Share on other sites

opps sorry

 

 

<?php

ob_start();

session_start();

 

define("OPEN", 1);

include "config.php";

include "classes.php";

 

if ($_POST['submit'])

{

$_SESSION['name'] = $_POST['name'];

$_SESSION['pass'] = $_POST['pass'];

$error = "The username and password are incorrect.<br />If you are not registered, please <a href='register.php'>register</a>; otherwise, try again.";

$query = mysql_query("SELECT * FROM member WHERE name= ''".$_SESSION['username']."'");

$row = mysql_fetch_assoc($query);

if (mysql_num_rows($query) == 0)

{

echo "The username does not exist. Please register.";

}

else if ($query['name'] == $_SESSION['name'])

{

if ($query['password'] == sha1($_SESSION['pass'])) header("Location: {$_SESSION['name']}");

}

else {

echo "error";

}

}

else {

echo "error";

}

 

 

if (isset($_SESSION['name'])) header("Location: {$_SESSION['name']}");

else

echo "<title>Coder's Alliance</title>

<h1>Coder's Alliance Login</h1>

<form action='$PHP_SELF' method='post'>

Username: <input type='text' name='name' size='40' length='40'><br />

Password: <input type='text' name='pass' size='40' length='40'><br />

<input type='submit' name='submit' value='Submit'>

<input type='reset' name='reset' value='Clear It'>

</form>";

?>

 

Link to comment
https://forums.phpfreaks.com/topic/66619-solved-error/#findComment-333767
Share on other sites

in my machine it give this output plz check

 

Warning: Failed opening 'config.php' for inclusion (include_path='.;c:\apache\php\pear') in c:\apache\htdocs\abhishek\t.php on line 6

 

Warning: Failed opening 'classes.php' for inclusion (include_path='.;c:\apache\php\pear') in c:\apache\htdocs\abhishek\t.php on line 7

 

this warning come out  bcoz i hav no database connect plz cut and paste above code surly it work

 

try it       

Link to comment
https://forums.phpfreaks.com/topic/66619-solved-error/#findComment-333772
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.