Blog Archives

Javascript : How To Disable ctrl+c and ctrl+u On Your Website


There are cases where you don’t want users to copy your content or view source in your website. So to do this just add the below piece of javascript code in your website and its done. jQuery(document).ready(function($){ $(document).keydown(function(event) { var

Tagged with:
Posted in Javascript

Javascript : How To Disable Right Click On Your Website


There are cases where you don’t want mouse right click to work in your website so to do this just add the below piece of javascript code in your website and its done. jQuery(document).ready(function($){ document.oncontextmenu = function() {return false;}; $(document).mousedown(function(e){

Tagged with: ,
Posted in Javascript

Facebook Developer : How to Get User Name Using Facebook User ID


When you are developing a facebook app, in many cases u need to know the name of the user. Normally you get it if the user gives the basic permission. But if you don’t want to store the name of

Tagged with: ,
Posted in Facebook Apps Development

Facebook : Redirect App From Appcenter to App Page


Normally when you make an apps on facebook and use the method:’apprequests’  of  FB.ui() function to invite friends to join the apps, then the friend gets a notification to join the app which is linked to your apps on facebook app

Posted in Facebook Apps Development, Facebook Tricks

MySQL: Insert record if not exists in table


CREATE TABLE `table_name` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, `tele` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB; Insert a record: INSERT INTO table_name (name, address, tele) SELECT * FROM (SELECT ‘Nazir’,

Posted in Mysql

Move Your Website’s Pictures Around Dimensions


First open the Website then Copy and paste the java script code to the address bar of your browser(Chrome, Firefox, IE etc..) javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName(“img”); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i

Tagged with:
Posted in Javascript

RTLing OpenCart Default Theme


1. Set your language to an RTL one We’ll go for Arabic. Go to your Admin Dashboard, go to the Languages page through the System > Localization > Languages, then click Insert to add your new Language. Below is how I

Tagged with:
Posted in OpenCart

How To Make Weather API for Websites


1. Make a folders called “api”, “cache”, “weather” 2. Now Make a file called “weather.php” inside folder “api”. 3. write the below code “weather.php” weather.php date_default_timezone_set(‘Asia/Dubai’); $date = date(‘Y-m-d’) ; $file_name_timestamp = strtotime($date); $filename = $_SERVER[‘DOCUMENT_ROOT’].’/api/cache/weather/’.$file_name_timestamp.’.php’; $weather_data=”; if (!file_exists($filename)) {

Tagged with: , ,
Posted in Mixz Tricks, PHP

jquery-Slide Effect not consistent and happening too many times with jquery 1.7


The code that worked : $(document).ready(function() { $(“.menuList li”).mouseenter( function() { $(this).find(“.submenuInner”).stop(true, true).css({“margin-top”:”0″}); $(this).children(“.submenu”).stop(true, true).slideDown(“slow”); }); //console.log(“menuin”); $(“.menuList li”).mouseleave( function() { $(this).children(“.submenu”).stop(true, true).slideUp(“slow”); //$(this).find(“.submenuInner”).animate({marginTop:”-100%”},{queue :false,duration :50}); $(this).find(“.submenuInner”).stop(true, true).animate({marginTop:”-100%”},500); }); }); The code that didn’t work : $(document).ready(function() { $(“.menuList li”).mouseenter(

Tagged with: ,
Posted in Jquery

PHP for loop that goes to certain number and again starts from zero


Here is the code that actually worked in my case : $start_time = some_dynamic_value; $end_time = some_dynamic_value; $i= $start_time; $flag = false; if($start_time > $end_time) $flag = true; while ($i <= $end_time || $flag) { echo $i; if($i == 24)

Tagged with: ,
Posted in PHP
Follow me on Twitter

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 443 other followers