[FX.php List] PHP question...

Bob Patin bob at patin.com
Wed Apr 29 09:06:48 MDT 2009


Gareth,

Thanks for the suggestion, but that doesn't fix the problem that a  
HEADER() won't work in the BODY of a page... tried it, nada...

I guess I just can't make it work. It seems like there *ought* to be a  
way to redirect from within the body of a page, but after searching  
the PHP docs, I can't find anything.

If anyone has a flash of inspiration, please let me know; thanks,

Bob Patin


-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_logo_idea3_120w.jpg
Type: image/jpeg
Size: 15728 bytes
Desc: not available
Url : http://mail.iviking.org/pipermail/fx.php_list/attachments/20090429/2995df31/new_logo_idea3_120w-0001.jpg
-------------- next part --------------


Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
AIM: longterm1954
FileMaker 9 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting

On Apr 29, 2009, at 9:57 AM, Gareth Evans wrote:

> Maybe you can use output buffering to only send the page if $counter  
> >= 1.
>
> ob_start();
> ... 75% of page ...
> $content = ob_get_contents();
> ob_end_clean();
>
> if ($counter < 1) {
>   header("Location: review.php");
> } else {
>   echo $content;
> }
>
>
> -- 
> GARETH EVANS
>
>
>> From: Bob Patin <bob at patin.com>
>> Reply-To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
>> Date: Wed, 29 Apr 2009 09:47:07 -0500
>> To: "FX.php Discussion List" <fx.php_list at mail.iviking.org>
>> Subject: [FX.php List] PHP question...
>>
>> I have a page that loads, and in the body of the code, there's a loop
>> that occurs that tries to load in database records if any exist.
>> Because of the way the site works, I have to run this loop in the  
>> body
>> of the page and not at the top, so 75% of the page has already been
>> loaded at this point.
>>
>> What I'd *like* to do is go to the next page if no records are  
>> loaded;
>> I have a variable that's easy to test, but I can't seem to get what I
>> want.
>>
>> I tried saying this:
>>
>> if ($counter<1){
>> header("Location: review.php");
>> }
>>
>> but for some reason, it doesn't actually send the user to the next
>> page. I can test and confirm that the IF statement does validate and
>> the code within IS run, but why doesn't it send the user to the next
>> page? Is it because a lot of the HTML has already loaded?
>>
>> If I use an INCLUDE() or REQUIRE(), the top part of this page will
>> show on the subsequent page, which is of course not what I want.
>>
>> Is there another way to redirect after the BODY of a page has already
>> started loading?
>>
>> Thanks,
>>
>> Bob Patin
>>
>> Longterm Solutions
>> bob at longtermsolutions.com
>> 615-333-6858
>> http://www.longtermsolutions.com
>> iChat: bobpatin
>> AIM: longterm1954
>> FileMaker 9 Certified Developer
>> Member of FileMaker Business Alliance and FileMaker TechNet
>> --------------------------
>> FileMaker hosting and consulting for all versions of FileMaker
>> PHP ? Full email services ? Free DNS hosting ? Colocation ?  
>> Consulting
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list