Current location: Hot Scripts Forums » Programming Languages » PHP » unexisted line error


unexisted line error

Reply
  #1 (permalink)  
Old 11-16-09, 02:39 AM
casualvictim casualvictim is offline
New Member
 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
unexisted line error

Ello thar,

I'm having an error in my php script in a weird way.
the error you see below is on line 193, although there are only 178 lines in the script.

Code:
Parse error: syntax error, unexpected $end in Root\login.php on line 193
PHP Code:

<html>

<?php require_once("menuHandler.php"); ?>
    <head>
   <link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="main">
      <div class="caption">Menu</div>
      <div id="container">
         <div id="menu"><?php createMenu('link-3'); ?></div>
         <div id="content">
            <p> De hompepage  <br> <br> Registreer je hier <br> <br> Log hier in </p>
         </div>
      </div>
      <div id="source">Lololololollerskates</div>
   </div>   
</body>
<?php
if(isset($_COOKIE['ID_my_site']))

{
$username $_COOKIE['ID_my_site'];
$pass $_COOKIE['Key_my_site'];
$check mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while(
$info mysql_fetch_array$check ))
{
if (
$pass != $info['password'])
{
}
else
{
header("Location: members.php");

}
}
}

if (isset(
$_POST['submit'])) { 

if(!
$_POST['username'] | !$_POST['pass']) {
die(
'Je bent iets vergeten in te vullen.');
}

if (!
get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$query_username $_POST['username'];
$check mysql_query("SELECT * FROM users WHERE username = '$query_username'")or die(mysql_error());  


$check2 mysql_num_rows($check);
if (
$check2 == 0) {
die(
'Gebruikersnaam bestaat niet <a href=add.php>Registreer je hier</a>');
}
while(
$info mysql_fetch_array$check ))
{
$_POST['pass'] = stripslashes($_POST['pass']);
$info['password'] = stripslashes($info['password']);
$_POST['pass'] = md5($_POST['pass']);

if (
$_POST['pass'] != $info['password']) {
die(
'Fout wachtwoord');
}
else
{

$_POST['username'] = stripslashes($_POST['username']);
$hour time() + 3600;
setcookie(ID_my_site$_POST['username'], $hour);
setcookie(Key_my_site$_POST['pass'], $hour);

header("Location: members.php");
}
}
}
else
{

?>


<head>
<title>
login
</title>
</head>


<?php
if(isset($_COOKIE['ID_my_site']))

{
$username $_COOKIE['ID_my_site'];
$pass $_COOKIE['Key_my_site'];
$check mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while(
$info mysql_fetch_array$check ))
{
if (
$pass != $info['password'])
{
}
else
{
header("Location: members.php");

}
}
}

if (isset(
$_POST['submit'])) { 

if(!
$_POST['username'] | !$_POST['pass']) {
die(
'Je bent iets vergeten in te vullen.');
}

if (!
get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$check mysql_query("SELECT * FROM users WHERE username = '$_POST[username]'")or die(mysql_error());

$check2 mysql_num_rows($check);
if (
$check2 == 0) {
die(
'Gebruikersnaam bestaat niet <a href=add.php>Registreer je hier</a>');
}
while(
$info mysql_fetch_array$check ))
{
$_POST['pass'] = stripslashes($_POST['pass']);
$info['password'] = stripslashes($info['password']);
$_POST['pass'] = md5($_POST['pass']);

if (
$_POST['pass'] != $info['password']) {
die(
'Fout wachtwoord');
}
else
{

$_POST['username'] = stripslashes($_POST['username']);
$hour time() + 3600;
setcookie(ID_my_site$_POST['username'], $hour);
setcookie(Key_my_site$_POST['pass'], $hour);

header("Location: members.php");
}
}
}
else
{

?>


<head>
<title>
login
</title>
</head>



<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<table border="0">
<tr><td colspan=2><h1>Login</h1></td></tr>
<tr><td>Username:</td><td>
<input type="text" name="username" maxlength="40">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="pass" maxlength="50">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="Login">
</td></tr>
</table>
</form>
}



<table border="0">
<tr><td colspan=2><h1>Login</h1></td></tr>
<tr><td>Username:</td><td>
<input type="text" name="username" maxlength="40">
</td></tr>
<tr><td>Password:</td><td>
<input type="password" name="pass" maxlength="50">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="Login">
</td></tr>
</table>
</form>
}
?>

</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 11-16-09, 01:01 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
You're mixing HTML and PHP code directly, which won't work. Wherever you use a bracket '{' or '}' (or any PHP code), you'll need to be in the PHP interpreter. For example:

Wrong:
HTML Code:
</td></tr>
</table>
</form>
}
?>
Right:
HTML Code:
</td></tr>
</table>
</form>
<?php
}
?>
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ and MSSQL tutorials? scott2500uk C/C++ 8 05-11-09 03:33 AM
No error message... stormshadow PHP 3 12-11-06 07:31 PM
Redirection back to a page from form submit DAL Perl 11 03-21-05 03:45 PM
I most definately suggest DevelopingCentral.com For Any Website Design/Development! Salty777 General Advertisements 2 10-01-04 05:27 AM
asp-iis-Server error nsuresh_rasr ASP.NET 3 02-08-04 01:47 AM


All times are GMT -5. The time now is 12:17 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.