How to troubleshoot old browsers

Ultimate Geek Tool

Yesterday Rob, a co-worker and friend, had one of these great ideas that helped us to solve a issue of visualization of content on a user agent. Just imagine you trying to see an error of CSS how it supposed to be without a virtualbox or a Windows XP for IE 6. It’s a hard deal to work it out, but there is a solution that might help any developer no matter what is the web-language that he programs on.

The principle is simple, use cURL to request the url that you are having issues and print the output. It is a very simple concept that will help more than a ton.

Here is the piece of code that you will need to do the request:

<?php

$url              = ‘https://mcloide.wordpress.com/‘;
$userAgent = ‘Mozilla/5.0 (Windows; U; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)’;

$browser     = curl_init($url);

curl_setopt($browser, CURLOPT_HEADER, true);
curl_setopt($browser, CURLOPT_RETURNTRANSFER, true);
curl_setopt($browser, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($browser, CURLOPT_USERAGENT, $userAgent);

$output = curl_exec($browser);

echo $output;

?>

This little piece of code will help you on getting weird bugs worked out.

It’s Friday, have fun.

Advertisements

About mcloide

Making things simpler, just check: http://www.mcloide.com View all posts by mcloide

2 responses to “How to troubleshoot old browsers

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: