FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need help with an error





DanielXP
I keep getting this error with a members script i changed

Code:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/leos4h/public_html/members/login.php on line 7



This is the login page and i change the 2nd echo

Code:
<?php
ob_start();
//include the header.php file
require("top.php");
echo "<br><br><br><br><center>";
//Write the login form out
echo "<form name="login" method=post action=login.php?action=check><table width="171" height="109"><tr><td width="17" height="37"><font size=2><font face="Arial">Username:</font><br><input type=text name=Uname size="20"></font></td></tr><tr><td width="17" height="37"><font size=2><font face="Arial">Password:</font><br><input type=password name=Pword size="20"></font></td></td></tr><tr><td width="17" height="24"><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="973%" id="AutoNumber1"><tr><td width="50%"><a href="javascript:document.login.submit();" style="text-decoration: none"><font color="#000000" face="Arial">Login</font></a></td><td width="50%"><font face="Arial"><a target="content" href="members/register.php" style="text-decoration: none"><font color="#000000">Register</font></a></font></td></tr></table></td></td></tr><tr></td></tr></table></form>";
//check the input
if($_GET['action'] == 'check')
{
//find the user
$result = mysql_query("SELECT * FROM loginphp WHERE Uname='{$_POST['Uname']}'") or die(mysql_error());
$row = mysql_fetch_array( $result ); //set $row to result
   if($row['Uname'] == "")
   {
      echo error();
   }
   else
   {
      //$enc = md5($_POST['Pword']);
      $enc = $_POST['Pword'];
      if($row['Pword'] == $enc)
     {
          $_SESSION['Uname'] = $_POST['Uname'];
          $_SESSION['lp'] = 'pl';
     header("Location: main.php");
          exit;
     }
     else
     {
        echo error();
     }
   }
}
if($_GET['action'] == 'registered')
{
echo "<b>Registered successfully</b>";
}
function error()
{
echo "<b>The username/password is incorrect</b>";
}
?>


Please help me
mathiaus
either backslash all quotes (\")
http://frihost.pastebin.com/715103

or echo <<<HTML stuff HTML;
http://frihost.pastebin.com/715107
DanielXP
i tryed the \" just before i put on here and it didn't work
DanielXP
Must of done something wrong copied you version and it works

Thanks so much Very Happy
DanielXP
- Closed -

No help neeeeeded no more

Mod / Admin lock topic
Related topics
phpBB2 ERROR PLEASE HELP
help explaining error messsage from CSS validator
[VB6] runtime error '424'??? help please
mysql base error please help
Php parsing error! Need help
Parse error - need help
Frontpage error please help
Error connecting to mysql ; please help
Need help with site getting error on http://validator.w3.org
Script error can any one help
Question: PHP scripting + cron jobs
ASPX XML parsing error help
Need help: Error in Wordpress file
Question About RaC Mod
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.