In this post, I just want to show you how to return the response in JSON format in the correct way in ZF2.Returning JSON response is very useful and we almost use for all AJAX integrations. Let’s see the below example […]
Detect Current Mouse Coordinates using JQuery
Here is the simple JQuery script snippet for detecting current mouse coordinates using JQuery function.
1 2 3 |
$(document).mousemove(function(e){ console.log("X = " + e.pageX + " and Y = " + e.pageY); }); |
1 2 3 |
window.onmousemove = function handleMouseMove(event) { console.log("X = " + event.clientX + " and Y = " + event.clientY); } |
How to detect robots and spiders with PHP?
Here is the simple function for detecting spiders and robots. It will return true or false.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
function is_bot(){ $bots = array( 'Googlebot', 'Baiduspider', 'ia_archiver', 'R6_FeedFetcher', 'NetcraftSurveyAgent', 'Sogou web spider', 'bingbot', 'Yahoo! Slurp', 'facebookexternalhit', 'PrintfulBot', 'msnbot', 'Twitterbot', 'UnwindFetchor', 'urlresolver', 'Butterfly', 'TweetmemeBot'); foreach($bots as $b){ if( stripos( $_SERVER['HTTP_USER_AGENT'], $b ) !== false ) return true; } return false; } |
Embed YouTube video in Powerpoint
Generally, you can easily embed a youtube video into your powerpoint presentation but unfortunately, iframe style embed is not working correctly, so if you want to embed a youtube video into powerpoint make a note of it […]
How to generate random string PHP
Generating random strings can be very useful in lot of cases.It might be for a verification code or a password etc. Below is the simple function by using this function you can generate random string. Basically this function […]
How to check if multiple element are in an array using PHP
We generally use in_array function to check if an element is in array or not , but this function does not allow as to check multiple elements in the array. so in today’s post i just wanted to share small code snippets […]
File Upload using Uplodify in Codeigniter?
In this Codeigniter tutorial, I will show you how to use Uplodify(HTML5 or Flash Multiple File Upload jQuery Plugin Script) in your CodeIgniter application. If you are new to uploadify feel free to read about Uploadify […]
How to retrieve data from database in CodeIgniter?
In this CodeIgniter tutorial, I will show you how to fetch data from database using model, view, controller approach. As usual, we need need to setup database connection in order to perform actions like select, insert, […]
PHP Geoplugin API – Find location with IP address
In this post i will show you, how to find the location based on the ip of the client. We gonna use geoPlugin’s geolocation web service.This web service allows you to find Location based upon the IP of the client. […]
WordPress wp_nav_menu with Twitter Bootstrap 3
Today’s post is about generating Twitter Bootstrap 3 HTML markup using WordPress’s menu component function wp_nav_menu(). Below are the HTML markup and PHP Script for generating the bootstrap3 menu, below script […]