Jump to content

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++;         
}
}
?>

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.