Via define() directive, like define ("MYCONSTANT", 100);
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.asp
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.asp
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 browser.
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();
– 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'] - The temporary filename of the file in which the uploaded file was stored on the server.
$_FILES[$fieldName]['error'] - The error code associated with this file upload.
The $fieldName is the name used in the .
$_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'] - The temporary filename of the file in which the uploaded file was stored on the server.
$_FILES[$fieldName]['error'] - The error code associated with this file upload.
The $fieldName is the name used in the .
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.
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 stamp' to find out the delay between starting and ending of a script execution. We will store the 'time stamp' value at the starting of the script and then again we will record at the end of the script . The difference of these two values will give us idea how much time the script has taken to execute. Note that here between two values of time we will try to add some delay by using 'sleep() function'. This sleep function takes numeric value in seconds and delay the execution for that many seconds. We can also create delay by using 'for loop' but this is a better solution. Here is the code.
We can set the time to unlimited value by making it to 0 value. Like this
$t1=time();
sleep(20);
$t2=time(); $t_lapsed=$t2-$t1;
echo "Total time lapsed = $t_lapsed";
We have introduced a delay of 20 seconds and this will execute without any problem, now increase the sleep value to 50 seconds and on execution you will get the error message saying maximum execution time exceeded. This is because by default the maximum execution time set at php.ini is 30 seconds. Now let us change the above code by adding one line set_time_limit(60). Here is the codesleep(20);
$t2=time(); $t_lapsed=$t2-$t1;
echo "Total time lapsed = $t_lapsed";
set_time_limit ( 60 ) ;
$t1=time(); sleep(50);
$t2=time();
$t_lapsed=$t2-$t1;
echo "Total time lapsed = $t_lapsed";
Now the script will execute fine without any error message. We can see the total time taken by the script.$t1=time(); sleep(50);
$t2=time();
$t_lapsed=$t2-$t1;
echo "Total time lapsed = $t_lapsed";
We can set the time to unlimited value by making it to 0 value. Like this
set_time_limit (0);
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 server.
Use ssh or telnet if you concern with security
You can also use rlogin to logon to a remote server.
Subscribe to:
Posts (Atom)




