Jump to content

yet ANOTHER Syntax Error . . . unexpected $end


Styles2304

Recommended Posts

so here it is:

 

<?php
include "auth.inc.php";
include "conn.inc.php";

if ($_SESSION['logging_out'] == 1) {

session_start();
session_unset();
session_destroy();

header("Refresh: 1; URL=../index.html");

} else {
?>

<html>
<head>
<title>Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">

</head>

<frameset cols="25%,75%">
  <frame src="links.php" name="left" noresize>
  <frame src="main.php" name="right" noresize>
</frameset>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">


</body>
</html>

<?php
}
?>

 

The unexpected end is at the </html> . . . I'm a little confuseled.

Link to comment
Share on other sites

Ok, I tried what NArc0t1c said . . . and this is the result:

 

1
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/styles/public_html/wcontrol/index.php:2) in /home/styles/public_html/wcontrol/auth.inc.php on line 2
23

 

Here's the code code for auth.inc.php:

 

<?php
session_start();
if ((isset($_SESSION['user_logged']) && 
      $SESSION['user_logged'] != "") ||
    (isset($_SESSION['user_password']) &&
      $_SESSION['user_password'] != "")) {
      
   //Do Nothing

} else {
  $redirect = $_SERVER['PHP_SELF'];
  header ("Refresh: 3; URL=../login.php?redirect=$redirect");
  echo "You are not currently logged in, you are being redirected to the login page. <br>";
  echo "(If your browser doesn't support this, <a href=\"../login.php?redirect=$redirect\">click here</a>)";
  die ();
}
?>

 

Oy, this is where stuff starts getting over my head.

Link to comment
Share on other sites

There really isn't much need in this case for that . . . I mean I didn't put in any "advanced" code, I was just trying to make it so if you hit logout, it sets a session variable, reloads the page without frames, then redirects you back to the initial home/login page.

 

Everything works 100% correctly without the code to make it do that . . . so does anyone have any ideas why the code that I entered and the code in auth.inn.con conflict?

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.