Jump to content
Fórum Script Brasil
  • 0

(Resolvido) Ajuda Parse error: syntax error, unexpected $end in


samuel701

Question

Ajuda a descobrir onde esta o erro aki neste codigo... não achei..

<?php
session_start();
include "level4_check.php";

$msg = "To edit a record click on the user name, to list by order click on titles.<br>YOU CANNOT EDIT ADMIN IN DEMO MODE.";

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

         $username = $_POST['username'];
        $userlevel = $_POST['userlevel'];
        $userid = $_POST['userid'];
                

$result = mysql_query("Update login_table set user_name='$username', user_level='$userlevel' where userid=".$_POST['userid']);
$msg = "Record is updated<br>To edit a record click on the user name";
$edit = "";
       

}






if(isset($_POST['Submit']))
{
    $total = $_POST['total'];
    $td = 0;
    $i = 0;
    
    for($i = 1; $i <= $total; $i++)
    {
        if(isset($_POST["d$i"]))
        {
            mysql_query("DELETE FROM login_table WHERE userid=".$_POST["d$i"],$con);
            $td++;
        }
    }

    $msg = "$td record(s) deleted!<br>To edit a record click on the user name";
}


if ($order == "") {$order = "userid";}

$result = mysql_query("Select * from login_table ORDER BY '$order'",$con);
$num = mysql_num_rows($result);
$n = 0;
?>
<html>
<head>
<title>Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#E1DEFE">


<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th class="header" scope="col"><div align="left" style="margin-left:10px;">AGTC - PHP Login management v1.1a - Administration - Developed by <strong>AGTC Websolutions @ </strong><a href="http://www.agtc.co.uk" target="_blank">http://www.agtc.co.uk</a></p></div></th>
  </tr>
</table>
<form name="form1" method="post" action="">
  <p class="smallTextBlack"><?php echo $msg; ?><br>USER LEVELS:<BR>1 = (HIGH RESTRICTION - CAN ACCESS LEVEL 1 ONLY)<BR>2 = (MEDIUM RESTRICTION - CAN ACCESS BOTH LEVELS 2 & 1)<BR>3 = (LOW RESTRICTION - CAN ACCESS BOTH LEVELS 3, 2 & 1)<BR>4 = (ADMIN AND ALL LEVELS)</p>
    <table width="100%" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
    <tr bgcolor="#A39FF6" class="standardText"> 
      <td width="5%" background="images/bar.gif"><div align="center" class="smallTextWhite">DELETE</div></td>
      <td width="5%" background="images/bar.gif"><div align="center"><a class="standardText" href="admin.php?order=userid">ID</a></div></td>
      <td width="20%" background="images/bar.gif"><div align="center"><a class="standardText" href="admin.php?order=user_name">USER NAME</a> </div></td>
      <td width="20%" background="images/bar.gif"><div align="center" class="smallTextWhite">PASSWORD </div></td>
      <td width="5%" background="images/bar.gif"><div align="center"><a class="standardText" href="admin.php?order=user_level">LEVEL</a></div></td>
      <td width="20%" background="images/bar.gif"><div align="center"><a class="standardText" href="admin.php?order=user_email">EMAIL</a></div></td>
      <td width="5%" background="images/bar.gif"><div align="center" class="smallTextWhite">USER IP </div></td>
      <td width="20%" background="images/bar.gif"><div align="center"><a class="standardText" href="admin.php?order=date">DATE REGISTERED</a> </div></td>
    </tr>
    <?php while($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$n++;
?>
    <tr> 
      <td width="5%"><div align="center"><?php if ($row['userid'] <> "185") {  ?>
        <input type="checkbox" name="d<?php echo $n;?>" value="<?php echo $row['userid'];?>"><? } ?>
      </div></td>
      <td width="5%"><?php echo $row['userid'];?></td>
      <td width="20%"><?php if($row['userid'] > "1") { ?><a href="admin.php?edit=<?php echo $row['user_name']?>"><?php } echo $row['user_name'];?></a></td>
      <td width="20%"><?php echo $row['user_pass'];?></td>
      <td width="5%"><center><?php echo $row['user_level'];?></center></td>
      <td width="20%"><?php echo $row['user_email'];?></td>
      <td width="10%"><?php echo $row['user_ip'];?></td>
      <td width="20%"><center><?php echo $row['date'];?></center></td>
    </tr>
    <?php

 }?>
    
      
    </tr>
      <div align="center"></div>
  </table>
  <input type="submit" name="Submit" value="Delete"> <input name="total" type="hidden" id="total" value="<?php echo $n?>">
<p> </p></form>
<!-- FORM FOR AMENDMENT -->
<?php if ($edit) {$msg = "Edit record below";
if ($edit == "admin") {$msg = "You cannot edit Admin in this demo"; exit ();}
$result = mysql_query("Select * from login_table WHERE user_name = '$edit'",$con);

$row = mysql_fetch_array($result)


?>


<form name="form2" method="post" action="">
<div class="smallTextBlack">Edit user :-</div>
<table width="60%" border="0" cellpadding="1" cellspacing="1" bordercolor="#000000">
 <tr bgcolor="#999999" class="smallTextWhite">
   
   <td background="images/bar.gif"><div align="center" class="smallTextWhite">ID</div></td>
   <td background="images/bar.gif"><div align="center" class="smallTextWhite">USER NAME </div></td>
   
   <td width="20%" background="images/bar.gif"><div align="center" class="smallTextWhite">USER LEVEL </div></td>
   
   
   <td background="images/bar.gif"><div align="center" class="smallTextWhite">DATE REGISTERED </div></td>
 </tr>
 <tr> 
      <td width="5%"><center><?php echo $row['userid'];?></center></td>
      <td width="15%"><input type="username" name="username" value="<?php echo $row['user_name'];?>"></a></td>
      <td width="15%">Change level: 
        <select name="userlevel">    <option>1</option>
                                                  <option>2</option>
                                                <option>3</option>
                                                <option>4</option></select>
         <span class="smallErrorText">CURRENTLY SET AT LEVEL: <?php echo $row['user_level'];?></span></td>
      
      
      <td width="10%"><div align="center"><?php echo $row['date'];?></div>        
      </td>
    </tr>
  </table> 
<input type="hidden" name="userid" value="<?php echo $row['userid'];?>">    
<input type="Submit" name="Amend" value="Update"></form>
<?php }?>

<p><a href="index.php">Back to index page</a></p>

</body>
</html>

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

eis aki o codigo do level4_check.php..

<?php
session_start();
include "config.php";

if(!isset($_SESSION['level'])){
echo"Error - You have not got authority to enter this page (ERR code: sesslev unset line 8)";        
}
if ($_SESSION['level'] != "4") {

echo"Your are not authorised to access this area - if this is incorrect please contact administration - <a href='login.php'>CLICK HERE TO LOGIN</a>";
exit();
}
?>

Link to comment
Share on other sites

  • 0

aki o codigo do config... as configuraçoes estao iguais a do banco de dados..

<?php
$localhost = "localhost";
$dbuser = "root";
$dbpass = "123";
$dbtable = "design";


$site_url = "http://www.agtc.co.uk"; 
$site_folder = "index.php"; 
$sendersName = "My Website Title"; 

$con = mysql_connect("$localhost","$dbuser","$dbpass")

        or die("Error Could not connect");

$db = mysql_select_db("$dbtable", $con)
        or die("Error Could not select database");
?>

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...