Re: How do I redirect to a new php file from the one I am in?

From: Chris Hope (blackhole_at_electrictoolbox.com)
Date: 04/07/04


Date: Wed, 07 Apr 2004 12:29:32 +1200

C-man wrote:

> Basically I have a login.php script that takes the users login and
> password, I then search in the database for the entry and discover if they
> have access 0 which is admin or access 1 which is normal user. Based on
> this I want to redirect the user to a new php file. Either admin.php or
> user.php depending on the access level.=l. Simple solution I am sure.

if($access == 0) {
        header("Location: admin.php");
}
else {
        header("Location: user.php");
}

I'm pretty sure I once read somewhere that the filename specified is
supposed to be a full url containing the domain name etc as well but it's
always worked for me just specifying the filename.

Chris

-- 
Chris Hope
The Electric Toolbox Ltd
http://www.electrictoolbox.com/


Relevant Pages

  • Re: Reset Drop Down List
    ... One possibility is to set a hidden field with the value on the reset pass ... and then use that value for the redirect. ... "Chris Moore" wrote in message ... >>X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: HP LaserJet 1020 - not Mac compatible - oh but it *is*..!
    ... Chris wrote: ... > I picked one up at John Lewis for £69 ... set it up and I was gutted to discover it is not ... > LaserJet 1020 in Word, ...
    (uk.comp.sys.mac)
  • Re: Issue with try / catch
    ... Klaus H. Probst, MVP ... "Chris" wrote in message ... > The below code updates the Active Directory entry via Directory Services, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Run script at entry of each page
    ... Superstition, or extra luck, I guess :-) ... > Dumb newbie question: Why the Response.Clear before the Redirect? ... > Chris Botha wrote: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: www.mysite.com/index.php?
    ... >>It means that I need to have a command there to redirect to ... directory index option. ... Chris Hope ...
    (alt.php)