February
14
2009
I’ve got a few people asking about how I got the seconds it took the page to load to display. Just wanna share the code:
1
| <?php timer_stop(1); ?> <?php echo $db->num_queries; ?> |
Or you can simply use:
1
| <?php echo('text before time' . timer_stop(0) . 'text after time'); ?> |
HTML is allowed in text before time and text after time.
Works in a WordPress environment only.
February
6
2009
Last month, I published a post about the WordPress functionthe_time('Y') and the PHP function date('Y')
Well as I was browsing through a few old posts, which were published in 2008, I noticed that the year date in the footer changed back to 2008. I changed it to
1
| <?php echo date('Y'); ?> |
Then it stayed as 2009! By the way, I know this can be figured out through common sense, but some lack it, this is obviously for disclaimers, footers etc. – NOT for posts.
December
22
2008
How to make your own phpinfo page…
Simply create a .php page and add this to it:
How simple…
December
13
2008
You may have read my previous post — Year PHP Code. Here’s an extra thing…
What if you wanna display the next year? You add the following…
1
| <?php echo date ('Y') + 1; ?> |
Output: 2011
When it does turn 2011, it will automatically change to 2012!
You can change the + 1 to any number that suits your needs!
December
2
2008
EDIT: date Instead of the_time
If you wanna use the current year for a copyright statement or whatever and not have to update it every year (if you’re that lazy
) Here’s how:
If you’re in a WordPress environment:
1
| <?php the_time('Y'); ?> |
Output: 2008
(Yes, I can execute PHP in my posts.)
And in any normal .php page, you can get the year from your server.
1
| <?php echo date('Y'); ?> |
Output: 2010
So on exactly 31/12/2008 11:59, it’ll be 2010, and the next minute, well.. you know what’s gonna happen.
December
2
2008

Ok from what I’ve been told my previous tutorial was too confusing. I’ll do it again. This time I’ll try to make it more detailed.
Yes, you heard me, Iframes out. Yes a site can work without them. Calm down
Why would you wanna get rid of Iframes?
1. They’re old
2. Too “limiting”
3. Its harder to get on Google etc. with them.
4. They’re un-professional IMO.
5. They rob scripts of their functionality.
I don’t hate them, I just dislike them.
So this is your index.html page, you should make sure tags are closed, and that there’s only one of the following tags:
- <html>…</html>
- <head>…</head>
- <title>…</title>
- <body>…</body>
(more…)
August
30
2008