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
https://forums.phpfreaks.com/topic/65502-yet-another-syntax-error-unexpected-end/
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.

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?

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.