Faqs

Faqs for all web development languages

How do you define a constant?

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

What does a special set of tags do in PHP?

The output is displayed directly to the browser.

What Is a Persistent Cookie?

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 More >

What is the difference between $message and $$message?

$message is a simple variable whereas $message is a reference variable. Example: $user = ‘bob’

is equivalent to

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

How can we repair a MySQL table?

The syntex for repairing a mysql table is:

REPAIR TABLE tablename REPAIR TABLE tablename QUICK REPAIR TABLE tablename EXTENDED

This command will repair the table specified. If QUICK is given, MySQL will do a repair of only the index tree. If EXTENDED is given, it will create index row by row.

How can we know the number of days between two given dates using PHP?

Simple arithmetic:

$date1 = date(‘Y-m-d’); $date2 = ’2006-07-01′; $days = (strtotime() – strtotime()) / (60 * 60 * 24); echo “Number of days since ’2006-07-01′: $days”;

What is meant by PEAR in php?

PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install “packages”

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 your 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.

What’s PHP ?

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 applications.

How do we reference HTML controls using Atlas?

<input type=”button” value=”button” />

You can reference the above HTML defined button using the below code snippet of JavaScript. We have also attached the onClick method with the button. This method will be called when we click the button.

var btnVisibility = new Sys.UI.Button($(‘Button1′)); btnVisibility.initialize();

btnVisibility.click.add(onClick);

You can refer other HTML elements like Label, Textbbox m CheckBox , Hyperlinks etc using the Sys.UI.