Posts

Showing posts from October, 2014

Why video and page loading stops when Mouse cursor or keyboard is not active in Mozilla?

video and page loading stops when Mouse cursor or keyboard is not active in Mozilla Actually i was facing same problem that it stops working when i leave my mouse cursor idle. Actually after 33 version of Mozilla  this have bug which stop these thing while cursor or keyboard is not active. So to solve this problem to page loading and video stop in Mozilla you need to follow the instruction as below; So for this you have to download 30 version of Mozilla and install this version into your computer. This will work fine. Hope this is helpfull. Please leave a comment if this works.

How to use try and catch in Error Handling?

Try and catch in Error Handling It is possible for a script to use multiple exceptions to check for multiple conditions. It is possible to use several if..else blocks, a switch, or nest multiple exceptions. These exceptions can use different exception classes and return different error messages: <?php class myException extends Exception {   public function errorMessage() {     $errMsg= 'Error on line '.$this->getLine().' in '.$this->getFile()     .': <b>'.$this->getMessage().'</b> is not a valid EMail address';     return $errMsg;   } } $email = "sagar@domain...com"; try {   //check if   if(filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) {     //throw exception if email is not valid     throw new myException($email);   }   //check for "example" in mail address   if(strpos($email, "example") !== FALSE) {     throw new Exception("$email is an example e-mail");  

What is function Overloading and Overriding in PHP?

Overloading  :-  Function overloading means you want more work or login from a function or  you can use different login in a function. You can not use same function in a class so for use this login you can use __call magic function where you can pass method name and parameter and can add login according to their parameter. Take a look on code:- class test { public function __construct() { //Your logic for constructor } public function __call($method_name , $parameter) { if($method_name == "overlodedFunction")  //Function overloading logic for function name overlodedFunction { $count = count($parameter); switch($count) { case "1": //Business log in case of overlodedFunction function has 1 argument echo "You are passing 1 argument"; break; case "2": //Incase of 2 parameter echo "You are passing 2 parameter"; break; case "3": //Incase of 2 parameter echo "You a