Page Redirect in PHP!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
askme
Forum Newbie
Posts: 5
Joined: Fri Feb 06, 2004 3:17 am

Page Redirect in PHP!!!!

Post by askme »

Is there is any equavalent code in PHP for this ASP code

Code: Select all

Response.redirect('login.asp');
User avatar
greenhorn666
Forum Commoner
Posts: 87
Joined: Thu Aug 14, 2003 7:14 am
Location: Brussels, Belgium

Post by greenhorn666 »

Code: Select all

header("HTTP 1.0 302 Found");
header("Location: login.asp");
This isn't a good way to redirect, you should use a absolute url instead, ie :
/user/login.asp
LonelyProgrammer
Forum Contributor
Posts: 108
Joined: Sun Oct 12, 2003 7:10 am

Post by LonelyProgrammer »

Take note that if you are on the windows platform, you may have problems with sessions if you redirect pages this way (or in any way).
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

<-- is on windows, and never has problems
<-- also has linux and never has problems

coders usually prefer linux, i prefer windows, why? ok, so your not necessarily scripting in your 'real environment' for when your site goes on-line, but linux is so annoying when it comes to link locations, dependencies, correct permissions etc etc my list could go on

eventually i will post a linux vs windows review, but dont expect linux to do to well
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

I would post a Windows vs Linux Review here myself, but we usually try to avoid things like that, as it's usually completely useless unless done right. When the statement "dont expect linux to do to well", it usually shows a bias towards one OS, and this will cause an incredible flamewar which will not help anyone.

Rather, for example, a "How to setup Windows for the desktop" tutorial would be good and acceptable, or other tutorials like it.

Reviews that compare X to Y are pretty much useless for the most part. Half the people will agree, and the other half will flame you. Thus resulting in a useless debate, or a <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span> contest.
Post Reply