Global variables in PHP can be registered using the session_register() function. It accepts different number of arguments, any of which can be either a string holding the name of a variable or an array consisting of variable names or other arrays
Example:
Session_register(“simple”);
$_session can also be used for registering variables.
Example:
$_SESSION['count'] =...
Tuesday, December 15, 2009
Wednesday, August 5, 2009
Tuesday, August 4, 2009
What is the difference between AIM and SIM in Authorize.Net?
8:49 PM
No comments
In SIM (Simple integration Method) customer credit card details are taken on the authorize.net site - no SSL required
AIM (Advanced integration Method) Credit card details are taken over your site SSL require.
please check setup instructions for more details http://www.ecommercetemplates.com/phphelp/ecommplus/authorizenet....
Thursday, July 23, 2009
If we login more than one browser windows at the same time with same user and after that we close one window, then is the session is exist to other windows or not? And if yes then why? If no then why?
Session depends on browser. If browser is closed then session is lost. The session data will be deleted after session time out. If connection is lost and you recreate connection, then session will continue in the brows...
Sunday, July 5, 2009
How session works (internal processing of session)?
To start a session:
– session_start()
– Creates a session identifier
– Session identifier is passed between client and server either as a Cookie, or in GET parameters
Then, can create, access, and modify session variables:
– $_SESSION[session_var_name] = value;
– $_SESSION is only available once you call session_start()
– $local_variable = $_SESSION[session_var_name];
– Can check if session variable is set by using isset();
To end a session:
– session_destroy...
Friday, July 3, 2009
How To Get the Uploaded File Information in the Receiving Script?
6:13 PM
No comments
Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
$_FILES[$fieldName]['name'] - The Original file name on the browser system.
$_FILES[$fieldName]['type'] - The file type determined by the browser.
$_FILES[$fieldName]['size'] - The Number of bytes of the file content.
$_FILES[$fieldName]['tmp_name']...
Tuesday, June 23, 2009
How to increase or decrease the maximum execution time of a php script ?
6:49 PM
No comments
By default PHP script execution time is set for 30 seconds at php.ini file. This is the time limit set for all the files to finish its execution. If the file takes more than this set time then the execution of the script will be stopped and error message will be displayed like this.
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\test.php on line 10
This maximum execution time limit is set inside the php.ini file like this.
max_execution_time = 30 ; Maximum execution time of each script, in seconds We will use 'time...
Monday, June 22, 2009
What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?
There is at least 3 ways to logon to a remote server:
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote serv...
Friday, June 5, 2009
How many ways I can redirect a PHP page?
a. Header function in PHP redirects to a new URL
Example:
<?php
header("Location: http://www.redirecturl.com/");
?>
b. http_redirect() is also used to redirect to a new page or URL.
Syntax
void http_redirect ( [string url [, array params [, bool session = FALSE [, int status]]]] )
Here, the URL is the path of the new page. params can be some query parameters followed by whether the session information needs to be passed and the custom response status co...
How do I find out the number of parameters passed into function ?
func_num_args() function returns the number of parameters passed ...
Wednesday, June 3, 2009
How many ways I can register the variables into session?
6:45 PM
No comments
Global variables in PHP can be registered using the session_register() function. It accepts different number of arguments, any of which can be either a string holding the name of a variable or an array consisting of variable names or other arrays
Example:
Session_register(“simple”);
$_session can also be used for registering variables.
Example:
$_SESSION['count'] =...
Tuesday, April 28, 2009
What Is a Session?
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.
There is only one session object available to the PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.
Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visit...
Monday, April 6, 2009
How to set .htaccess 301 redirection?
11:37 PM
No comments
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
For more details refer http://www.seobook.com/archives/001714.shtml ...
Tuesday, February 10, 2009
How to prevent hotlinking in php?
5:31 PM
No comments
Hotlinking is the act of one site embedding content (such as images, audio files, and videos) hosted on another site. This uses up the ‘bandwidth’ (data transfer allowance) of the site hosting the file, which can be very expensive for webmasters who pay for hosting by the amount of data transferred — as a result, hotlinking is often called ‘leeching’ or ‘bandwidth theft’.
Hotlinking can be prevented using the .htaccess file on an Apache web server, but cheaper web hosting packages often don’t allow webmasters to change this file. The code...
How can we destroy the session, how can we unset the variable of a session?
11:56 AM
No comments
session_unset() function frees all session variables currently registered.
If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use unset() to unregister a session variable.
i.e. unset ($_SESSION['varname']...
What is the difference between Split and Explode in PHP?
11:05 AM
No comments
The split() function splits the string into an array using a regular expression and returns an array.
Ex: split(":","India:Pakistan:Srilanka"); returns an array that contains India, Pakistan, Srilanka.
The explode() function splits the string by string.
Ex: explode("and", "India and Pakistan and Srilanka"); returns an array that contains India, Pakistan, Srilanka.
split() function is deprecated as of php5.3.0 . Use preg_split instead of split...
Monday, February 9, 2009
Would you initialize your strings with single quotes or double quotes?
3:04 PM
No comments
Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substituti...
What's PHP ?
2:47 PM
No comments
The PHP Hypertext Preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applicatio...
Subscribe to:
Posts (Atom)