redirecting

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
pixelwraith
Forum Newbie
Posts: 18
Joined: Wed Apr 14, 2004 11:01 am

redirecting

Post by pixelwraith »

is it possible to redirect other than in the header?
eg if i have code like:


if (....)
{ redirect}

else
{}

:)
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post by PrObLeM »

header('Location: file.php');
User avatar
mudkicker
Forum Contributor
Posts: 479
Joined: Wed Jul 09, 2003 6:11 pm
Location: Istanbul, TR
Contact:

Post by mudkicker »

you can use meta tags for redirect as well, but header is of source better..
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

if you want to use header redirect after output, you can use output buffering ob_start()
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

you can do a location.replace via JS

works just as good and you dont have to tamper with the buffering.
Post Reply