Jump to content

error


bleured27

Recommended Posts

i Know it is Kind a lame becose its a basic error

i tried over an our to find it only i faild

so i come here plz help me

 

 

Parse error: syntax error, unexpected '}' in /Applications/XAMPP/xamppfiles/htdocs/sessions/bannthem.php on line 52

<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL); 
session_start();


if ($_SESSION["loggedin"] == null):

   header("location:home.php");


endif; 
$host = 'localhost'; // Server Host Name
$user = 'root'; // Server User Name
$password = ''; // Server Password
$db = 'test'; // Your Database


$link = mysql_connect($host,$user,$password) or die('Error in Server information');
mysql_select_db($db,$link) or die('Can not Select Databasse');
$query = "select * from userinfo where username='{$_SESSION['theuser']}' and password='{$_SESSION['pass']}'";

$res = mysql_query($query) or die(mysql_error());

$rows = mysql_num_rows($res);
if($rows!=1)
{
header('location:home.php');
}
elseif($_SESSION['theuser']=="bleured"); 

$banuser= $_POST['username2'];
$unban= $_POST['username'];

if($unban==$banuser):
header('location:ban.php');
endif;

if($unban!="");
{
$query2 = "select * from userinfo where username='$unban'";
}
$res2 = mysql_query($query2); //Executing query and saving result in Result Set


$rows2 = mysql_num_rows($res2);


if($rows2==1)
{
mysql_query("UPDATE userinfo SET ban='0' where username='$unban'")
}
else
{
echo"not a correct username"; 
}
if($banuser!=""):
$query3 = "select * from userinfo where username='$banuser'"
}
$res3 = mysql_query($query3); //Executing query and saving result in Result Set


$rows3 = mysql_num_rows($res3);


if($rows3==1)
{
mysql_query(UPDATE userinfo SET ban='1' where username='$banuser');
}
else
{
echo"not a correct username"; 
$query3 = "select * from userinfo where username='$unban'"
}
endif

include'ban.php';
else {
header('location:home.php');
}

Link to comment
Share on other sites

try this

<?php
ini_set('display_errors', 'On');
error_reporting(E_ALL); 
session_start();


if ($_SESSION["loggedin"] == null){

   header("location:home.php");
} 
$host = 'localhost'; // Server Host Name
$user = 'root'; // Server User Name
$password = ''; // Server Password
$db = 'test'; // Your Database


$link = mysql_connect($host,$user,$password) or die('Error in Server information');
mysql_select_db($db,$link) or die('Can not Select Databasse');
$query = "select * from userinfo where username='{$_SESSION['theuser']}' and password='{$_SESSION['pass']}'";

$res = mysql_query($query) or die(mysql_error());

$rows = mysql_num_rows($res);
if($rows!=1)
{
header('location:home.php');
}
elseif($_SESSION['theuser']=="bleured"){ 

$banuser= $_POST['username2'];
$unban= $_POST['username'];

if($unban==$banuser){
header('location:ban.php');
}
}

if($unban!=""){
$query2 = "select * from userinfo where username='$unban'";

$res2 = mysql_query($query2); //Executing query and saving result in Result Set


$rows2 = mysql_num_rows($res2);


if($rows2==1)
{
mysql_query("UPDATE userinfo SET ban='0' where username='$unban'")
}
else
{
echo"not a correct username"; 
}
if($banuser!=""){
$query3 = "select * from userinfo where username='$banuser'"

$res3 = mysql_query($query3); //Executing query and saving result in Result Set


$rows3 = mysql_num_rows($res3);
}

if($rows3==1)
{
mysql_query(UPDATE userinfo SET ban='1' where username='$banuser');
}
else
{
echo"not a correct username"; 
$query3 = "select * from userinfo where username='$unban'"
}


include('ban.php');
else {
header('location:home.php');
}

Link to comment
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.