Jump to content

Why do i get an error help


madspof

Recommended Posts

I have this script but it keeps giving me this error Parse error: parse error, unexpected '[' in C:\Deskfun\Halo 3 clan\updateusers.php on line 65, i think its is becuase i have an if function in a while funcation that is in a if funcation again any way any help would be apprecaited thanks here is hte code:

  <?php
  // Check if there is a cookie, if there isn't then exit!
  if (!isset($_COOKIE['cookie_info'])) {
      echo "You are not logged in.";
  exit;
       }
  	elseif (!isset($_COOKIE['cookie_info1'])) {
echo "You are not an admin.";
exit;
}
else{
include 'connect.php';

$activate = "";
$query  = "SELECT Gamertag, Authorised FROM members";
$result = mysql_query($query);
$count = 1;
while($row = mysql_fetch_assoc($result))
{
if(row[Authorised] == 1){
$activate = "Deactivate";
}
else{
$activate = "Activate";
}
echo "Name :{$row['Gamertag']} <br>" .
         "activated : $activate <br>";



$count++;         
}
}
?>

 

Link to comment
https://forums.phpfreaks.com/topic/72184-why-do-i-get-an-error-help/
Share on other sites

I hope this works

 

<?php
  // Check if there is a cookie, if there isn't then exit!
  if (!isset($_COOKIE['cookie_info'])) {
      echo "You are not logged in.";
  exit;
       }
  	elseif (!isset($_COOKIE['cookie_info1'])) {
echo "You are not an admin.";
exit;
}
else{
include 'connect.php';

$activate = "";
$query  = "SELECT Gamertag, Authorised FROM members";
$result = mysql_query($query);
$count = 1;
while($row = mysql_fetch_assoc($result))
{
if($row['Authorised'] == 1){
$activate = "Deactivate";
}
else{
$activate = "Activate";
}
echo "Name :{$row['Gamertag']} <br>" .
         "activated : $activate <br>";



$count++;         
}
}
?>

Archived

This topic is now archived and is closed to further replies.

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