display text at the bottom of page

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
stevestark5000
Forum Commoner
Posts: 61
Joined: Thu Jan 27, 2011 12:08 am

display text at the bottom of page

Post by stevestark5000 »

I am trying to put the following code at the bottom of the page but the echo and print commands display the code at the top of the page. how to display it at the bottom?

Code: Select all

echo round((memory_get_usage()/1024)/1024, 2) . 'MB of memory used';
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: display text at the bottom of page

Post by Benjamin »

Well you would want to put that code in the html, where you want it displayed.
stevestark5000
Forum Commoner
Posts: 61
Joined: Thu Jan 27, 2011 12:08 am

Re: display text at the bottom of page

Post by stevestark5000 »

yes but the problem with that, the code will not get parsed
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: display text at the bottom of page

Post by Benjamin »

Why not?
stevestark5000
Forum Commoner
Posts: 61
Joined: Thu Jan 27, 2011 12:08 am

Re: display text at the bottom of page

Post by stevestark5000 »

i am not sure why it will not parse the theme.tpl file. inside that file i have {FOOTER}. outside that file i have the code to call the footer, everything displays correctly but the php code does not get parsed.

outside i have this code

Code: Select all

$THEME["FOOTER"] = "<table border='0'>
 <tr><td><?php echo round((memory_get_usage()/1024)/1024, 2) . 'memory used';?>.</td></tr>
</table>
Last edited by stevestark5000 on Sun May 08, 2011 2:24 am, edited 2 times in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: display text at the bottom of page

Post by Benjamin »

Well if you are using a framework you need to research how to assign variables from the controllers and display them in the views.
stevestark5000
Forum Commoner
Posts: 61
Joined: Thu Jan 27, 2011 12:08 am

Re: display text at the bottom of page

Post by stevestark5000 »

could you have another look at my above post. i added to it since you last replyed
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: display text at the bottom of page

Post by Benjamin »

If you're assigning the entire footer to a variable, it should look something like this:

Code: Select all

$THEME["FOOTER"] = "<table border='0'>
 <tr><td>" .  round((memory_get_usage()/1024)/1024, 2) . 'memory used' . ".</td></tr>
</table>";
stevestark5000
Forum Commoner
Posts: 61
Joined: Thu Jan 27, 2011 12:08 am

Re: display text at the bottom of page

Post by stevestark5000 »

thank you Benjamin, it worked
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: display text at the bottom of page

Post by Benjamin »

:drunk:
stevestark5000
Forum Commoner
Posts: 61
Joined: Thu Jan 27, 2011 12:08 am

Re: display text at the bottom of page

Post by stevestark5000 »

what are those dots called in the above code again?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: display text at the bottom of page

Post by Benjamin »

Post Reply