To pass the information into the script from outside, help can be taken from the PHP CLI (Command line interface) method. Suppose addition of two numbers has to be passed to PHP then it can be passed like this on the command line:
php add.php 2 3
Here the script name is add.php, and 2 and 3 are the numbers that has to be added by the script. These numbers are available inside the script in an array called $argv. This array contains all the information on the command line; the statement is stored as follows:
So, $argv always contains at least one element — the script name.
Then, in your script, you can use the following statements:
$sum = $argv + $argv;
$argc is a variable that stores the numbers of elements in $argv. $argc is equal to at least 1, which is saved for the name of the script. Example is $argc=3 using the above statements.
There is a decent page in the php manual on the subject, in short mysql_pconnect() makes a persevering association with the database which implies a SQL join that don't close when the execution of your script closes. mysql_connect()provides just for the database new association while utilizing mysql_pconnect , the capacity would first attempt to locate a (relentless) connection that is as of now open with the same host, username and password. On the off chance that one is found, an identifier for it will be returned as opposed to opening another connection... the connection with the SQL server won't be terminated when the execution of the script ends. Rather, the link will stay open for future use.
The principle distinction amongst sessions and cookies is that sessions are put away on the server, and cookies are put away on the client's PCs in the content record position. Cookies can not hold various variables,But Session can hold numerous variables.We can set expiry for a cookie,The session just stays dynamic the length of the program is open.Users don't have admittance to the information you put away in Session,Since it is put away in the server. Session is mostly utilized for login/logout reason while cookies utilizing for client movement following.