WebVirtue Software Solutions is a global IT solutions and services provider. We provide Offshore Software Development - Website Design, Web Application Development Services, Software Outsourcing and Offshore Outsourcing, to Clients Globally.

   
 
 

  Previous Posts

 

  Archives

 

Friday, November 28, 2008


PHP vs. Java. vs. Perl vs. Ruby

Java still is the hottest programming language searched for (even compared to C++, python, etc.), and that was quite to my surprise. May be Java is not only used in the web development world and I feel this is why it is on top. I can't remember the last time I saw an applet and I don't see much of Java questiosn in web development forums i visit, but stats say it. I feel the interesting part about this graph is that PHP still reigns in internet scripting world, don't see much of Perl and Ruby hardly shows any trend.
Click here to see the graph

Thursday, November 27, 2008


Google Maps API & PHP

Using a combination of a couple APIs, PHP and Curl you can easily incorporate maps into your website that fairly accurately identify a visitor’s location. Knowing a users location and further being able to map the location has many practical applications. I am going to breakdown the core elements of creating a map just like the one above. I plan on following up soon with more advanced Google Maps examples.
You will need the users’ address to begin. If you run a site that collects that information during registration it can be used for mapping otherwise you can get the users city, state and country by grabbing their IP address and then calling one of the available geocoding APIs available.

You will also need a Google Maps API key which can be requested from http://code.google.com/apis/maps/index.html.

Call the Google API to get the latitude and longitude.
$key = "Your Google Maps API Key";
$address = urlencode($city.", ".$country);
$sturl = 'http://maps.google.com/maps/geo?q=' . $address . '&output=csv&key=' . $key;
$ch = curl_init($sturl);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$res = curl_exec($ch);
$resinfo = curl_getinfo($ch);
curl_close($ch);
$res = explode(",",$res);
$latitude = $res[2];
$longitude = $res[3];

Insert an image tag with the following SRC referencing Google’s API.
http://maps.google.com/staticmap?key=' . $key . '&size=506x280&markers=' . $latitude . ',' . $longitude . '&zoom=3

This is just the tip of the iceberg. For more details on the API visit the Google documentation at http://code.google.com/apis/maps/documentation/.