Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-26-2007, 01:54 AM   PM User | #1
bunny1
New Coder

 
Join Date: Feb 2007
Posts: 92
Thanks: 1
Thanked 0 Times in 0 Posts
bunny1 is on a distinguished road
displaying a value and calling a function

i want to display a variable at the top of the page but i cannot run the code to get that variable until after because i am displaying a table at a certain place on the page using that code.

Basically to get that value i was thinking if i called the function it would allow me to then display the current value after all the code has been run
However this displays all the output from that function at the top
Is there a way of calling a function without displaying it's output but just using selected values from that function

Or is there another way i can do this
I'll be shocked if anyone understands what i jus tried to explain!

thanks
bunny1 is offline   Reply With Quote
Old 03-26-2007, 02:46 AM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
My head hurts. Maybe you want output buffering? I can honestly say I have no idea what you mean.
Inigoesdr is offline   Reply With Quote
Old 03-26-2007, 04:09 AM   PM User | #3
iLLin
Regular Coder

 
Join Date: Oct 2005
Location: Right Here
Posts: 654
Thanks: 1
Thanked 0 Times in 0 Posts
iLLin is an unknown quantity at this point
Use a class, call the function, set two variables:

$this->top_output = $top;
$this->bottom_outpupt = $bottom;

Then echo the top, then go down the page and echo the bottom. Or use sessions, or just use two variables and forget the function.

Either way you have to run the code first to get your value, then just store your bottom output in another variable to display later.
iLLin is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:38 PM.


Advertisement
Log in to turn off these ads.