Logo F2FInterview

Php Advanced Interview Questions

Q   |   QA

Anwser 1:
$message is a simple variable whereas $$message is a reference variable. Example:

$user = ‘bob’

is equivalent to

$holder = ‘user’;
$$holder = ‘bob’;

Anwser 2:
They are both variables. But $message is a variable with a fixed name. $$message is a variable who’s name is stored in $message. For example, if $message contains “var”, $$message is the same as $var.

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.

The output is displayed directly to the browser.

Via define() directive, like define (“MYCONSTANT”, 100);

When users clicks the submit button, files specified in the <INPUT TYPE=FILE…> will be transferred from the browser to the Web server. This transferring (uploading) process is controlled by a properly written <FORM…> tag as:

<FORM ACTION=receiving.php METHOD=post ENCTYPE=multipart/form-data>

Note that you must specify METHOD as "post" and ENCTYPE as "multipart/form-data" in order for the uploading process to work. The following PHP code, called logo_upload.php, shows you a complete FORM tag for file uploading:

<?php

print("<html><form action=processing_uploaded_files.php"

." method=post enctype=multipart/form-data>\n");

print("Please submit an image file a Web site logo for"

." fyicenter.com:<br>\n");

print("<input type=file name=fyicenter_logo><br>\n");

print("<input type=submit>\n");

print("</form></html>\n");

?>

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: