Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP redirect

Status
Not open for further replies.

wrongidea

Programmer
Nov 12, 2001
5
JP
Hi everyone.

I'm trying to have an include file which checks a session variable which
indicates if the users have logged in to the application or not, and if they
haven't, the include file would redirect them to the login page.

It seems like a rather simple task, but I sometimes (only sometimes...and
that's what's confusing about this too...) get an error saying "Page not
foud", or "error loading xxxx.php".

I assume it has something to do with header("Location: $login_page");
function, but I can't tell exactly what is wrong with it, since it only
happens once in a while.

I'm running apache 1.3.22 and PHP 4.1.2.

Thanks in advance.
 
Well, sometimes i have the same problem under windows. To solve that i replaced the header function by the javascript call

<script language=javascript>
window.location=&quot;</script>
Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top