Google Maps API provides a way to get Latitude and Langtitude. With this post I want to explain how to get Latitude, Langtitude of the particular palce using address. Add this lines within the head tag <script src="https://maps.googleapis.com/maps/api/js?sensor=true"></script> <script> var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { directionsDisplay = new google.maps.DirectionsRenderer(); var hyderabad = new google.maps.LatLng(17.3850440, 78.4866710); var mapOptions = { zoom:6, mapTypeId: google.maps.MapTypeId.ROADMAP, center: hyderabad } map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);   directionsDisplay.setMap(map); directionsDisplay.setOptions( { suppressMarkers: true } ); } </script> And add this lines: <body onload="initialize()"> <div id="map_canvas" style="float:left;width:70%;height:100%;"></div> </body> Now you will get nice google map in your site. Now add these lines to function initialize() var geocoder = new google.maps.Geocoder(); var address = ‘Nagpur’; // address which [&hellip

Read More...

Google Maps provides API to implement Route directions map. With this post I want to explain Google Maps integration within your site with different Markers(Icons). Add this lines within the head tag <script src="https://maps.googleapis.com/maps/api/js?sensor=true"></script> <script> var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { directionsDisplay = new google.maps.DirectionsRenderer(); var hyderabad = new google.maps.LatLng(17.3850440, 78.4866710); var mapOptions = { zoom:6, mapTypeId: google.maps.MapTypeId.ROADMAP, center: hyderabad } map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);   directionsDisplay.setMap(map); directionsDisplay.setOptions( { suppressMarkers: true } ); } </script> And add this lines: <body onload="initialize()"> <div id="map_canvas" style="float:left;width:70%;height:100%;"></div> </body> Now you will get nice google map in your site. Then write on more Javascript function within the script tag like this: function calcRoute() { var start = ‘Hyderabad’; // Route path starting [&hellip

Read More...

It is right time to share one of nice article with you freinds…. Recently i started working on making websites for mobiles(iPhone). I had a great experience with it. I come across with the image orientation issue with banner in home page. I have done some research on it. Finally i could get the solution for it. My requirement is that: I need to apply the class dynamically based on the mobile orientation. If mobile is oriented in portrait mode then the widh of banner should be 320px and apply some styles. In other case, If mobile is oriented in landscape mode then the widht of banner should be 480px and apply some styles

Read More...

Hello Friends, I would like to share small topic related to image resizing functionality in PHP here. I have used timthumb script for image resize functionality. It is open source script. We can feel free to use it and share it to others. It has beautiful functionality for image resizing. Recently i have been asked by my client regarding image resizing as “Images should be resized but it should not be distorted”.I tried very hard to make the images resized but i could fail to resize them according to aspect ratio. Then i googled┬á for it and i could find the solution as “Timthumb is good solution for you in this case”. I downloaded the timthumb script and used it. It is working great and [&hellip

Read More...

Would you like to know with what keyword takes user to your site form google/bing/yahoo? If yes it is right place for you to know about it. You can simply know about it by going through google analytics. But i dont go for GA for this small thing. I just want to show visitors for of my site in my personal admin area. To achieve this i have written small php code. Please have a glance on it. The following is the small php code to know the keyword used by visitor of your site. You just copy this code and save it in one php file. Also you can integrate it into any of your webpage

Read More...

Hi Friends, I would like to share small javascript code which is aimed to provide add more option to your static HTML form. I used this code to provide add more option to add additional fields in my HTML form. It is working great. It might be useful for you.´╗┐ Open your HTML document and add the following javascript code in your head tag . This code is to create and remove dynamic div for HTML document. Javascript function to create dynamic div

Read More...

Hi, I am working on LAMP stack. I enforced to install the curl library in-order to run the curl functions. curl is the php library which provides functions to get the content remote location. And it allows us to communicate different web-servers with different protocols. So i installed the curl library in my ubuntu system by using following commands. Assume that you have already working with LAMP stack then. Go to terminal and run the following command: Applications –> Accessories –> Terminal

Read More...

Hello, Here is the simple php code to get the short url. I have used the following code to get the short url by passing the long url to bit.ly. It takes long url and send us smart url. So that we can use this short url anywhere. Following is the snippet: < ?php /* this function is to make a URL small */ function make_bitly_url($url,$login,$appkey,$format = ‘xml’,$version = ’2.0.1′) { //Prepare the URL $bitly = ‘http://api.bit.ly/shorten?version=’.$version.’&longUrl=’.urlencode($url).’&login=’.$login.’&apiKey=’.$appkey.’&format=’.$format;   //get the url // you can also use the use cURL here $response = file_get_contents($bitly); //parse depending on desired format if(strtolower($format) == ‘json’) { $json = @json_decode($response,true); return $json[’results’][$url][’shortUrl’]; } else //xml { $xml = simplexml_load_string($response); return ‘http://bit.ly/’.$xml->results->nodeKeyVal->hash; } }   //Usage of the the function   [&hellip

Read More...

PHP offers two main options to get a remote file content, ie: curl and file_get_contents. But there is lots of difference between these two. Curl is a much faster and alternative to file_get_contents. The request(http://www.google.com) will be served/responded within 0.198035001755 seconds using file_get_contents where as the same page request will be served/responded within 0.025691986084 seconds using cUrl. So cUrl is much faster than file_get_contents. cUrl is more preferable to access remote page content even it is little bit complicated to code. The following is the php code to get the remote site content using cUrl: < ?php function curl_get_contents($url) { // Initiate the curl session $ch = curl_init(); // Set the

Read More...

socialmention(http://socialmention.com/) is providing the mentions of your domain branded keywodrs. It is providing the mentions for your brands in form of xml,csv,json. If you want to get the socialmentions from twitter/facebook/googleblogs/stumbleupon, then you can proceed with the following. It is very easy to get the mentions and display them as you wish. URL to get the socialmentions: http://api2.socialmention.com/search?q=keywords&f=format&src[]=socialmedia Where

Read More...