What are the functions for IMAP?What Is a Persistent Cookie?So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?Is it possible to set a time expire page in PHP?List out different arguments in PHP header function?What Are the File Upload Settings in Configuration File?How can you access a COM object from a PHP page?How can we know the count/number of elements of an array?How many ways I can register the variables into session?How do you define a constant?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?How session works (internal processing of session)?What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?How many ways I can redirect a PHP page?How do I find out the number of parameters passed into function ?What Is a Session?What are encryption functions in PHP?In how many ways we can retrieve data in the result set of mysql using php?What does a special set of tags = and ?> do in PHP? ~ Interview Questions & Answers
imap_body - Read the message body
imap_check - Check current mailbox
imap_delete - Mark a message for deletion from current mailbox
imap_mail - Send an email message
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.
Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.
5, it’s a reference to existing variable.
Yes it is Using header("Expires: Mon, 26 Jul 2007 05:00:00 GMT");<?php header("Expires: Mon, 26 Jul 2007 05:00:00 GMT"); ?>
void header ( string string [, bool replace [, int http_response_code]])
There are several settings in the PHP configuration file related to file uploading:
• file_uploads = On/Off - Whether or not to allow HTTP file uploads.
• upload_tmp_dir = directory - The temporary directory used for storing files when doing file upload.
• upload_max_filesize = size - The maximum size of an uploaded file.
By utilizing the com_load and the dotnet_load respectively
you can incorporate COM objects and .NET libraries into your
PHP code, thus anytime you see "library code" in a question,
make sure you remember these two functions.
com_load — Creates a new reference to a COM component [deprecated]
Deprecated, use the OO syntax instead.
<?php
// do this
$obj = new COM($module);
// instead of this:
$obj = com_load($module);
?>
2 ways:
a) sizeof($array_name) - This function is an alias of count()
b) count($array_name) - This function returns the number of elements in an array.
Interestingly if you just pass a simple var instead of an array, count() will return 1.
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'] = 0;
Via define() directive, like define ("MYCONSTANT", 100);
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.
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();
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.
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 code.
func_num_args() function returns the number of parameters passed in.
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 visitor.
mysql_fetch_array - Fetch a result row as an associative array, a numeric array, or both
mysql_fetch_assoc - Fetch a result row as an associative array
mysql_fetch_object - Fetch a result row as an object
mysql_fetch_row —- Get a result row as an enumerated array
The output is displayed directly to the browser.