adding some PHP
#1
I want to have a PHP code at the top of every webpage (before the <html> tag) and another PHP code before the </body> tag. Where do I go / what do I edit?

Thank you.
#2
just edit all the files that you download in the zip pack (edit index.php, and all the others in the folder.

What exactly is it that you want to do??
#3
get a page generated in *** seconds on the bottom ef each page
#4
ok, well, whats the code you are using??
#5
put
<?php $mtime = microtime(); $mtime = explode(" ",$mtime);  $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime; ?>
before the <html>

and put
<?php $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0];  $tend = $mtime; $totaltime = ($tend - $tstart); printf ("              Page generated in <U>%f</U> secs", $totaltime); ?>
in the body
#6
ok, well, I would have said add it to the header and footer template, unfortunatly, I dont think they support php :/

So, I would suggest this:
<?php $mtime = microtime(); $mtime = explode(" ",$mtime);  $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime; ?>
before the <html> like you said, but put
<?php $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0];  $tend = $mtime; $totaltime = ($tend - $tstart); $totaltime); ?>
Then:
Page generated in <U>%f</U> secs
in the header and footer template. Im not sure if this will work, you could try for one of the pages.
#7
the page im using it for is at http://guillaumelforum.theglassprison.net/index.php (you can see the results for yourself)
#8
it just says
Page generated in %f secs

I know the script works see http://guillaumelforum.theglassprison.net/test.php
#9
I would recommend waiting for Chris to do this. There might already be a timer a you can print to the page. If there isn't he'd probably know the easiest way to accomplish what you are trying to do.

And no... the templates don't support PHP so placing anything PHP related in a template besides variables will not work.
Matt Light
MattLight.com
If you want my help, be sure to follow the posting tips.
#10
hmm, ok, maybe putting the code into functions somewhere and calling it might work??


Forum Jump:


Users browsing this thread: 1 Guest(s)