Welcome to WebmasterWorld Guest from 54.147.63.124

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

variable used before it's assigned

     
2:27 pm on Feb 23, 2010 (gmt 0)

New User

5+ Year Member

joined:Feb 23, 2010
posts:6
votes: 0


i have to display a variable at the top of the page, and the variable is assigned in the middle of the page...

how can i do that? thank you.
3:02 pm on Feb 23, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Feb 22, 2009
posts:1396
votes: 0


Hi there busystock,

Just quickly thinking, couldn't you assign the var to a session and then refresh the page then:-

echo (isset($_SESSION['some_session']) ? $_SESSION['some_session'] : '');


Again just a thought, but you can see the process there hopefully...

Cheers,

MRb
3:05 pm on Feb 23, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


assign it at the top of the page

a little more specific information about the scenario would probably help give a more useful answer
11:35 am on Feb 25, 2010 (gmt 0)

New User

5+ Year Member

joined:Nov 11, 2008
posts: 12
votes: 0


Hello,

Why dont you assign the variable at the top of the page and assign the other data (what you are using in the middle of the page) in variables at the same point, then call on them in the middle of the page.