Jump to content

[SOLVED] Unexpceted ';' error... was just working fine ..


techiefreak05

Recommended Posts

im REALLY confused as to why i JUST am NOW getting this error...

 

Parse error: parse error, unexpected ';' in /homepages/5/d191754224/htdocs/search/logout.php on line 18

 

in this page:

 

<?php
session_start();

if(!isset($_SESSION['email'])){
echo $_SESSION[id];
echo $_SESSION[fname];
echo $_SESSION[email];
echo $_SESSION['id'];
echo $_SESSION['fname'];
echo $_SESSION['email'];
?>

Error, you are not current logged in, please <A HREF="/?">Go Home</a>

<?php
}else(

// LINE 18 as stated in error // mysql_query("UPDATE `users` SET `status` = 'Offline' WHERE `id` = '$_SESSION[id]'");
   unset($_SESSION[email]);
   unset($_SESSION[fname]);
   unset($_SESSION[id]);
   $_SESSION = array();
   session_destroy();
?>

<center><h4>Logging Out ...</h4></center>
You have successfulyl logged out! please <br><br><A HREF="/?">Go Home</a>

<?
}
?>

 

that exact code.. the way it is now.. was working not 1- mintues ago... but not anymore.. i changed NOTHING

<?php
session_start();

if(!isset($_SESSION['email'])) {
echo $_SESSION['id'];
echo $_SESSION['fname'];
echo $_SESSION['email'];
echo $_SESSION['id'];
echo $_SESSION['fname'];
echo $_SESSION['email'];
?>

Error, you are not current logged in, please <A HREF="/?">Go Home</a>

<?php
} else {

mysql_query("UPDATE `users` SET `status` = 'Offline' WHERE `id` = '{$_SESSION['id']}'");
   unset($_SESSION['email']);
   unset($_SESSION['fname']);
   unset($_SESSION['id']);
   $_SESSION = array();
   session_destroy();
?>

<center><h4>Logging Out ...</h4></center>
You have successfulyl logged out! please <br><br><A HREF="/?">Go Home</a>

<?
}
?>

 

Your else statement was coded as: } else ( instead of } else {

wow ... thanks. haha. but why would it work before and not now? i haven't edited it at all.

 

Either you had a different version 'edited' or you're using Windows and Windows does weird stuff.

 

Assuming the coding problem - unlike the mysterious "hadn't edited" - is solved, would you please mark it so.

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.