Apparently the autocomplete attribute is now supported in HTML5.
Category Archives: Programming
Smallest 1×1 pixel transparent GIF image
Looking for a small 1×1 pixel transparent GIF image to use in your website? Here is a 1×1 pixel transparent GIF image. You could use a transparent PNG instead, but then the file size would be bigger, so why would you do that? :)
SEO Best Practices for URL Structure
Read this article SEO Best Practices for URL Structure this evening and learned to use no more than 3-5 words in your URL as according to Google’s Matt Cutts if there are more than 5 words Google algorithms typically will just weight those words less and just not give you as much credit.
Formatting a float as a percentage in PHP
To format a float value as a percentage in PHP:
$formatted = sprintf( '%.2f', $value * 100 );
Are Prepared Statements a waste for normal queries? (PHP)
I was interested to know if using prepared statements was a waste of time if the statement was only going to be used once. I found Are Prepared Statements a waste for normal queries? (PHP) on StackOverflow and basically came away with the understanding that it’s a pretty low overhead and it’s good for security so you might as well use prepared statements all the time.
PHP Best Practices
Found a great article today! PHP Best Practices.
To use mysqli or PDO?
I’m trying to make my mind up about whether I should be using mysqli or PDO for a project I’m just starting and I’ve found a few relevant articles:
- PDO vs. MySQLi: Which Should You Use?
- mysqli or PDO – what are the pros and cons?
- When to use MySQL, MySQLi, or PDO in PHP
- Should I use mysql, mysqli or PDO?
- Why you Should be using PHP’s PDO for Database Access
- Not Convinced PDO is Everything It’s Hyped Up to Be
- PHP Driver: MySQL vs MySQLi vs PDO MySQL
- PHP mysqli overview
- The diffrence beteen PHP’s PDO bindParam & bindValue
- PHP, PDO, MYSQLI opinions please
And based on all of that I think I’ve decided to use PDO.
Why you Should be using PHP’s PDO for Database Access
Found an article tonight: Why you Should be using PHP’s PDO for Database Access. Skimmed it. Plan to read the whole thing later.
jQuery Templating Plugin
Today I learned about the jQuery Templating Plugin. Looks like something I’ll want to learn about!
Firefox prompting to download application x-trash from Apache2
I was changing a HTML file index.html to be a PHP file called index.php and I renamed my index.html file index.html.bak. The plan was that Apache would find index.php rather than index.html and serve that as the default page. But when I went to load my page Firefox was asking me if I wanted to save the file with MIME type application/x-trash — not what I was expecting! It turns out the problem was related to the index.html.bak file, apparently Apache had decided that was the default page and then when it tried to get the MIME type for .bak it came up with application/x-trash. So the solution was to move the index.html.bak file to something with a filename that didn’t begin with ‘index.html’ (I used ‘original-index.html’) and then once that file had been renamed the index.php page was served properly.