Hi, I have an odd error in my logout.php file maybe you can help me.

I have this in the start of my file:

<?php
   include('../config.php');
   session_destroy();
   session_unset();
?>

In config.php I have session_start();

A little down in the page I have this:

<?php
echo 'Logged out...';
echo '<meta http-equiv="REFRESH" content="0;url=index.php">';
?>

And the error is:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /public_html/short/admin/logout.php on line 1

Can you help me? Thanks!

whats in your config file. it appears as though the error may be coming from there.

Member Avatar for megachip04

what is on line 1? as referred to by the error

Also, you might try using " in your include instead of '?

ex. include("../config.php");

In my config.php I have the database connection things and session_start(); and error_reporting(0);

Member Avatar for megachip04

when I have gotten this error it is usually because I have an extra character somewhere.

like a ' or " or )

have you had any further developments on this issue?

<?php
include('../config.php');
session_destroy();
session_unset();
?>

Remove the indentation white spaces from these lines. Like this

<?php
include('../config.php');
session_destroy();
session_unset();
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.