Tips

  1. URL file access with a cURL backup

    So in the process of getting my website up and running, I ran into the ‘URL file-access is disabled in the server configuration’ message. Since the server admin was asleep, I figured I’d try to find a workaround. cURL is a commonly used one for this scenario, but the problem is that if you switch hosts it may not be available. As such, here’s a handy variable to tell if URL file access is enabled:

    ini_get('allow_url_fopen')

    It returns true or false depending on the value in the php.ini file, and you can throw it in an if statement to test for it, and use cURL in the else statement in case it fails.

  2. Valid Blogger RSS Output

    Having trouble getting your blogger rss output to validate because Google botched the tracking code (lack of alt attribute in the tracking image)?

    Do what I did, add this to the php page processing the rss feed:

    $entry['content'] = substr($entry['content'], 0, -8) . " alt='' />";
    

    This cuts out the closing img and div tag, adds alt, and closes it all again… just pray google doesn’t change it >.>