Powered By Blogger

Sunday, 7 August 2011

What’s the special meaning of __sleep and __wakeup?

__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.

What Is a Persistent Cookie?

A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:
• Temporary cookies can not be used for tracking long-term information.
• Persistent cookies can be used for tracking long-term information.
• Temporary cookies are safer because no programs other than the browser can access them.
• Persistent cookies are less secure because users can open cookie files see the cookie values.

What is the difference between session_register and $_session?

Following are differences between session_register and $_SESSION

1. session_register function returns boolean value and $_SESSION returns string value

2. session_register function does'nt work if register_global is disabled. $_SESSION works in both case whether register_global is disabled or enabled. So using $_SESSION for session variable manipulation is more appropriate.

What is the difference between Notify URL and Return URL?

Notify URL and Return URL is used in Paypal Payment Gateway integration. Notify URL is used by PayPal to post information about the transaction. Return URL is sued by the browser; A url where the user needs to be redirected on completion of the payment process.   

How we can get the value of current session id?

We can get the value of our current session id by using session_id().It returns the value of our current session id.

ow we can increase the execution time of a PHP script?

I have given you some function using them you can increase the execution time of a PHP script.Default time for execution of a PHP script is 30 seconds.
These are,
1.set_time_limit()//change execution time temporarily.
2.ini_set()//change execution time temporarily. 
3. By modifying `max_execution_time' value in PHP
configuration(php.ini) file.//change execution time permanent.

How we can upload videos using PHP?

When want to upload videos using PHP we should follow these steps:
1.first you have to encrypt the the file which you want to upload by using "multipart-form-data" to get the $_FILES in the form submition.
2.After getting the $_FILES['tmp_name'] in the submition 
3.By using move_uploaded_file (tmp_location,destination) function in PHP we can move the file from original location.