Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.