More Beginner Questions

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
TheFisherman
Forum Newbie
Posts: 8
Joined: Fri Nov 14, 2003 6:43 pm
Location: Plano, Texas

More Beginner Questions

Post by TheFisherman »

I am trying to figure out the equivalent of the ASP response.redirect. I would appreciate any help on this problem.
Nay
Forum Regular
Posts: 951
Joined: Fri Jun 20, 2003 11:03 am
Location: Brisbane, Australia

Post by Nay »

header("Location: wherever.html");

-Nay
TheFisherman
Forum Newbie
Posts: 8
Joined: Fri Nov 14, 2003 6:43 pm
Location: Plano, Texas

Post by TheFisherman »

Thanks Nay, that seems to compile correctly. I am now having a problem with the command itself. I am trying to redirect to a local page at the top of the php code, and I get the error message :

Warning: Cannot add header information - headers already sent by (output started at d:\inetpub\tanstafl.com\rgc\Login.php:9) in d:\inetpub\tanstafl.com\rgc\Login.php on line 14

How do I get him to wait on sending the HTTP headers???

Thanks again,
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

try using

Code: Select all

<?php

ob_start();

/// your code here

ob_end_flush();
?>

edit : bech100 just a little faster then i :P
TheFisherman
Forum Newbie
Posts: 8
Joined: Fri Nov 14, 2003 6:43 pm
Location: Plano, Texas

Thanks

Post by TheFisherman »

Got it, thanks a million.
Post Reply