Piping Incoming Mail with PHP
Jun/090
I wrote this article about a year and a half ago. Some people might find it helpful:
http://www.phpshare.org/articles/Piping-Incoming-Mail-with-PHP.html
Making Margins Work in Internet Explorer 6
Jun/090
This is an old trick, but many of you might not yet know it. Any time you want to use a margin on an element with CSS, Internet Explorer 6 will try to double its magnitude. Adding: display: inline; to the element should stop Internet Explorer 6 from doing this.
But then again, IE6 is a dying breed. I try as hard as the next guy to not support it, but it keeps popping up =/
Keeping Your PHP Efficient
Jun/090
Did you know that isset($str{5}) is 176% faster than strlen($str) > 5? If you didn’t, you should check out this article:
http://www.joomlaperformance.com/articles/performance/52_php_programming_tips_43_14_2.html
PHP’s mail() Function and Google Apps
Jun/090
Whenever I try to send e-mails to people with personalized domains that use Google Apps (http://www.google.com/a/) for their mail handling, they never go through. I wrote a quick PHP function to check to see Google is servicing a particular e-mail address:
function isGoogleAppEmail($email)
{
$host = explode('@', $email);
getmxrr($host[1], $mxhosts);
$mxhosts = array_map('strtolower', $mxhosts);
$num = count($mxhosts);
$gmail = false;
for ($i = 0; $i < $num; $i++)
{
if ($mxhosts[$i] == 'aspmx.l.google.com')
{
return true;
}
}
return false;
}
Class C IP Addresses
Jun/090
I recently learned about the importance of using different Class C IP addresses for web sites. Essentially, every site on the Internet belongs to some IP address. To have different Class C IP addresses for your sites means that when one site belongs to say 208.101.38.240, another belongs to 208.101.xx.yyy, where xx is not 38 and yyy is any three digit number.
Most web hosts contain their clients within the same Class C range of IP addresses. Thus, they might assign someone to 208.101.38.210 and another to 208.101.38.211. This presents a problem for people who want to get high search engine listings. Many search engines do not count backlinks from websites that are on the same Class C block as your site is. The most logical reason for this is that they don’t want people to be able to create two separate websites and link to each other in order to gain backlinks. While it shouldn’t hurt your search listings, it won’t help them. This can be problematic for people who receive links to their site from the same host. For example, imagine that you own a web hosting company and many of your clients link back to you because they think you’re a great host. All of those backlinks won’t count towards your PageRank for Google, even though they are legitimate.
The solution to the problem is to request a different Class C IP address from your web host. You’ll probably be charged for it, however.
Hanging Indent
Jun/090
If you ever want to have a hanging indent for paragraphs, list items, etc., then you can do something like this:
p
{
text-indent: -30px;
margin: 0 0 0 30px;
}
This will indent every line except the first line 30 pixels to the right.
Use TrueType Fonts on Websites with Cufon
Jun/090
I thought this was really interesting, but I’m not sure that I’ll use it as the text cannot be highlighted. Maybe I’ll use it for titles.
http://wiki.github.com/sorccu/cufon/usage
Redirect domain.com to www.domain.com with .htaccess
Jun/090
I always include the following code into the .htaccess file for my websites so that Google will always assign the same PageRank to both www.domain.com and domain.com.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^[^w]{3}[^\.]
RewriteRule ^(.*)$ http://www.domain.com/$1 [r=301,L]
Welcome
Jun/090
So I’ve finally started a WordPress blog to share some of the many “tricks-of-the-trade” that I’ve learned over the years…