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
stevestark5000
Forum Commoner
Posts: 61 Joined: Thu Jan 27, 2011 12:08 am
Post
by stevestark5000 » Sun May 08, 2011 12:38 am
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';
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sun May 08, 2011 1:33 am
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
Post
by stevestark5000 » Sun May 08, 2011 1:35 am
yes but the problem with that, the code will not get parsed
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sun May 08, 2011 1:42 am
Why not?
stevestark5000
Forum Commoner
Posts: 61 Joined: Thu Jan 27, 2011 12:08 am
Post
by stevestark5000 » Sun May 08, 2011 2:07 am
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.
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sun May 08, 2011 2:08 am
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
Post
by stevestark5000 » Sun May 08, 2011 2:23 am
could you have another look at my above post. i added to it since you last replyed
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sun May 08, 2011 2:31 am
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
Post
by stevestark5000 » Sun May 08, 2011 9:49 pm
what are those dots called in the above code again?