Thursday, July 2, 2009

Easy way to Parse RSS in PHP

Here is some simple code for parsing RSS 2 in PHP. It's so easy, I can't believe it.

<?php
     $doc = new DOMDocument();
   $doc->load('http://www.softarea51.com/rss/windows/Web_Development/XML_CSS_Utilities.xml');
   $arrFeeds = array();
   foreach ($doc->getElementsByTagName('item') as $node) {
    $itemRSS = array (
      'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
     'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
     'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
     'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue
     );
    array_push($arrFeeds, $itemRSS);
   }
?>  

Thanks to: How to parse RSS feeds with PHP

Monday, June 22, 2009

CSS Image Replacement for Buttons

Yes, you could just use the input type="image" but if you want to replace buttons with images purely with CSS, this is a great method.


A quick note, this won't work in IE6 unless you set your button as a BUTTON not an INPUT. This is a very important point.

Friday, June 19, 2009

Keep Footer at the Absolute Bottom of Page

Have you ever wanted to have a footer always be on the bottom of the page, even if the content of the page wasn't very tall? Usually people use javascript, but below is a way to do it with only CSS. This even works on IE6!


P.S. if you view source on the above link, you will see all the CSS and HTML you need. It works great!

Wednesday, June 3, 2009

Nice Drop Down Menues

I've been on a quest for a long time to find a good, reliable and customizable dropdown menu. I've found some but this is a great one to try out:

Thursday, May 28, 2009

PHP Mail on Windows Server

I had a weird problem with my PHP mail() function on a windows server. When I was trying to send the emails, the email headers would show up in the body of the email itself. After a lot of frustration, I figured out a solution that worked for me.

After each header, you usually add a "\r\n". It seems like the \n was giving us the problem so I took it off. So after each header I had instead "\r". It worked... so there you go.

For example:

$headers = 'From: someemail@email.com' . "\r";
$headers .= 'MIME-Version: 1.0' . "\r";
$headers .= 'Reply-To: replytoemail@email.com' . "\r";

Wednesday, May 20, 2009

Ajax with jQuery

jQuery makes it really easy to implement AJAX.  Check out this out for more information: http://docs.jquery.com/Ajax

If you're not sure what jQuery is or AJAX, check out some of our other posts in those categories.

Tuesday, May 12, 2009

Social Bookmarking Links

Here is a great resource if you'd like to add buttons to your site for social networking links.  For example, if you have an article and want to create a Digg This link.  There are a lot of ways to do this but here is one simple way: