Subscribe For Free Updates!

We'll not spam mate! We promise.

Feb 24, 2013

Increase Execution Time-PHP



Increase Execution Time -Php Language To prevent the script from timing out, You need to increase the execution time of the specific processing script. Here's a trick how to do it.

PHP CODE


ini_set('max_execution_time', 300);


Place this at the top of your PHP script. The script will execute for 5 minutes(maximum).
You can set your own time limit here.

Feb 23, 2013

Only variable references should be returned by reference


Only variable references should be returned by reference :
Consider the following example :
<?php
class myClass {
    public $var = 1;

    public function &getVar() {
        return($this->var);
        }
}

$obj = new myClass;
$value = &$obj->getVar();
?>

The above example should arise the error, 
To solve it like below code:
<?php
class myClass {
    public $var = 1;

    public function &getVar() {
        return $this->var;
        }
}

$obj = new myClass;
$value = &$obj->getVar();
?>
Another Easiest Example is given below :
return $this->auth ? $this->ehlo() : $this->helo();
Change the above line to below one.
$return = $this->auth ? $this->ehlo() : $this->helo();
return $return;

By

XAMPP Increase the Import File Size of database backup in XAMPP - linux


1. In terminal, type the following command

vi /opt/lampp/etc/php.ini


2. To edit in php.ini,

file_uploads = On
upload_max_filesize = 20M

and save this file.

Step : 3
To Restart Xampp,

/opt/lampp/lampp restart


Step : 4
Now open Phpmyadmin in Browser and import file upto 20MB.

JavaScript to find Mouse cursor X and Y axis value


In javascript we can find the mouse cursor points - the coordinate of the mouse pointer by using the following javascript function.

$().mousemove(function(e){
$('div').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);
});
</script>
<div>
</div>

The above function display the x and y axis values inside the div element.
In some browser need jquery.js file .. This file is available in many websites.

403 Forbidden Error in WampServer


Error - You don’t have permission to access / on this server error occured in wampServer

Solution.
1. Open the file named as “phpmyadmin.conf. phpmyadmin.conf  is phpmyadmin configuraiton file.
You need to replace some of line like below.

Original code.

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 


Replaced code

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from (your ip address)(or)all




NOTE: ‘c:/wamp/apps/phpmyadmin3.X.X/ this is the path of the directory where you install your wamp server.
Here you need to replace this path accordingly. By this change you are able to view your wamp server phpmyadmin panel.

2. Open the file named as “httpd.conf .This is the Apache configuration file.
This file placed in below path.
 “C:/wamp/bin/apache/Apache2.2.22/conf
In this file you need to change the code.

First search this code “# onlineoffline tag – don’t remove

Then replace “Allow from 127.0.0.1 with “Allow from (Your ip address)
(or)
remove “Allow from 127.0.0.1 and replace “Deny from all with "Allow from all


That's all. Now once restart Your WampServer and Enjoy.

Feb 10, 2013

Add Favicon Image to HTML


Add Favicon Image to HTML site


Favicon is an image (icons/png) associated with a Web page/Web site. This favicon image is shown in the address bar or in tabs.. This is for website identity.

The following code should be in style tag.

<link rel="icon" type="image/png" href="http://techniqzone.blogspot.in/favicon.png">

if the favicon image is .ico format, then follow the below code.
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
Once you have created a favicon.ico file, you simply upload it to the root directory and add these two lines of coding to your webpage, making sure they go into the <head> section of your coding.