Session Help

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
User avatar
WiZARD
Moderator
Moderator
Posts: 1256
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: Session Help

Post by WiZARD » Wed Feb 26, 2003 1:02 am

Strange question.....
what is it?

Code: Select all

/** Redirect to the home page **/ 
header( "location: ../content/index.php" );
}

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Post by Oleg Butuzov » Wed Feb 26, 2003 1:06 am

headers already send - it means that you have simething print before sending sesions headers....

User avatar
xlordt
New php-forum User
New php-forum User
Posts: 34
Joined: Thu Dec 12, 2002 9:00 pm
Location: NJ
Contact:

Post by xlordt » Wed Feb 26, 2003 8:46 am

You should just replace...

this..

Code: Select all

/** Redirect to the home page **/ 
header( "location: ../content/index.php" );
}


to this...

Code: Select all

echo '<meta http-equiv="refresh" content="2;url=../content/index.php(or url)">';

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Post by Redcircle » Wed Feb 26, 2003 12:03 pm

1st. do not use session_register when using super global $_SESSION. it will act quirky or explode on you.

2nd. make sure that <?php is the very first thing in the file. make sure there is nothing output to the browser before <?php is called.

3rd header calls cannot be made after you see anything on the browser. like the 2nd thing I mentioned.

4th. If you do need to make a header call for a redirection make sure you include the FULL url. i.e http://www.yourserver.com/somepage.html older versions of Netscape, Opera, IE, Mozilla require the FULL url or will not work.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest