Posts

Showing posts from 2014

Display transparent image over Image using CSS

Here is the code where you will get image over another image, HTML: <table class="travel_map_prefer ">  <tr> <td class="images"><img src="image1.jpg"  height="150" width="300"/>      <div class="music-detail" >       <a href="javascript:void(0);" class="show_prefer" >Prefer this</a>       </div>      <span style="float:right;">Mission Bay Beach&nbsp; </span></td> </tr> </table> CSS: .travel_map_prefer  td.images:hover { background:url(play.png);  } .travel_map_prefer td.images { float: left; width: 312px; position: relative; } .travel_map_prefer .music-detail { background: #000; background: rgba(0, 0, 0, 0.5); position: absolute; top: 5px; left: 5px; height: 150px; width: 300px; color: #989DA2; display: none; z-index: 10; } .travel_map_prefer  td.images:hover .music-detail { trans...

Google API - To check whether address is valid or Invalid.

Hi Friends! Today i am gonna share how to find the address whether it is valid or invalid. Here is the link where google is providing API for that,  http://maps.googleapis.com/maps/api/geocode/json?address=<your_address>&sensor=true This will return an JSON format  output. If the address is valid, the Status will be " OK " else the Status will be " ZERO_RESULTS "

Avoid Image width and height distraction with CSS.

Hi! Hope everyone is fine! Today i am going to share how to avoid image distraction with CSS.Have a look below code and it will do magic! Here is your HTML code, <a href="#" class="img-thumbnail"> <img src="image1.jpg"  /> </a> Here is you CSS code, .img-thumbnail{     background: none repeat scroll 0 0 #111111;     display: inline-block;     height: 160px;     overflow: hidden;     width: 200px; } .img-thumbnail img {     width: 100%; }

How to add comma (,) and AND (&) atlast using implode

Hi, I see many of them will be thinking how to display array values with comma but to display last one as &. Here is the code where it will list all the array values with comma separated but last value it will replace &. $arr = array('red','pink','blue','violet'); $last = array_pop($arr); $string = count($arr) ? implode(", ", $arr) . "& " . $last : $last; Output:  ------------ red, pink, blue &violet Hope this will be useful.

Redirect 404 page through .htaccess

Hi, Today i am going to explain how to redirect 404 page using .htaccess. Here is the code, you have to put this code in your .htaccess file which will be under root directory. <IfModule mod_rewrite.c>   Options +FollowSymlinks   RewriteEngine On   RewriteBase / RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$  /404.php </IfModule>   Its very easy to use. If your .htaccess is not working you have to enable it from apache.  Please follow these steps, 1. Open your httpd.conf file 2. Make sure LoadModule rewrite_module modules/mod_rewrite .so line should be enable (by removing # before this line.)

Get Android version using Javascript

Hi! Today i am going to share how to get android version using Javascript. Here is the code, <script> function getAndroidVersion(ua) {     var ua = ua || navigator.userAgent;     var match = ua.match(/Android\s([0-9\.]*)/);     return match ? match[1] : false; }; getAndroidVersion(); //"4.2.1" parseInt(getAndroidVersion(),10); //4 parseFloat(getAndroidVersion()); //4.2 </script> Hope you got it. Any queries please leave a comment.

Expedia PHP SimpleXML API code

Hi, Today i am going to share how to retrieve datas from XML using expedia API sandbox. Here you find Expedia API Tester, http://devhub.ean.com/apitester/index.html You can use any queries based on your requirement. Then you have to process the query. Once done, you will get API link using this link you can retrieve Array in PHP. Here you go, <?php $context  = stream_context_create(array('http' => array('header' => 'Accept: application/xml'))); $api_key = '***********'; $url = 'http://api.eancdn.com/ean-services/rs/hotel/v3/list?cid=55505&minorRev=150&apiKey='.$api_key.'&locale=en_US&currencyCode=USD&xml=<HotelListRequest><city>Seattle</city><stateProvinceCode>WA</stateProvinceCode><countryCode>US</countryCode><arrivalDate>2/16/2014</arrivalDate><departureDate>2/18/2014</departureDate><RoomGroup><Room><numberOfAdults>2</nu...