You are on page 1of 48

What are the differences between Get and post methods in form submitting, give the case

where we can use get and we can use post methods?

In the get method the data made available to the action page ( where data is received ) by
the URL so data can be seen in the address bar. Not advisable if you are sending login
info like password etc.In the post method the data will be available as data blocks and not
as query string.

What is the difference between mysql_fetch_object and mysql_fetch_array?

MySQL fetch object will collect first single matching record where mysql_fetch_array
will collect all matching records from the table in an array

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

Both are two variables. In the second case the value of the $message will be substituted
in the $message part and a new variable will create. i.e., $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.

What is difference between require_once(), require(), include().

Difference between require() and require_once(): require() includes and evaluates a
specific file, while require_once() does that only if it has not been included before (on the
same page).So, require_once() is recommended to use when you want to include a file
where you have a lot of functions for example.
Difference between require() and include() is that require() produces a FATAL ERROR if
the file you want to include is not found, while include() only produces a WARNING.
There is also include_once() which is the same as include(), but the difference between
them is the same as the difference between require() and require_once().

What is the difference between echo and print statement?

echo() can take multiple expressions,Print cannot take multiple expressions.
echo has the slight performance advantage because it doesn't have a return value.
I need to convert all single-quotes (') in a string to a backslash followed by a single-
quote. How can I do this with a regular expression?

First off, take a look at the addslashes() function. It will do exactly what you want. You
should also have a look at the magic_quotes_gpc directive in your php.ini file.The
ereg_replace magic you're looking for, however, is simply:

$escaped = ereg_replace("'", "\'", $input);

When I do the following, the output is printed in the wrong order:

function myfunc($argument) {
echo $argument + 10;
}
$variable = 10;
echo "myfunc($variable) = " . myfunc($variable);

What's going on?

To be able to use the results of your function in an expression (such as concatenating it
with other strings in the example above), you need to return the
value, not echo it.

What type of inheritance that php supports?

In PHP an extended class is always dependent on a single base class, that is, multiple
inheritance is not supported. Classes are extended using the keyword 'extends'.

What are the differences between mysql_fetch_array(), mysql_fetch_object(),
mysql_fetch_row()?

mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or
both.
mysql_fetch_object - Returns an object with properties that correspond to the fetched
row and moves the internal data pointer ahead. Returns an object with properties that
correspond to the fetched row, or FALSE if there are no more rows
mysql_fetch_row() - fetches one row of data from the result associated with the
specified result identifier. The row is returned as an array. Each result column is stored in
an array offset, starting at offset 0.

Explain different types of errors in php (i.e. arguments in error reporting function)?

Three are three types of errors:
1. Notices: These are trivial, non-critical errors that PHP encounters while executing a
script - for example, accessing a variable that has not yet been defined. By default, such
errors are not displayed to the user at all - although, as you will see, you can change this
default behaviour.
2. Warnings: These are more serious errors - for example, attempting to include() a file
which does not exist. By default, these errors are displayed to the user, but they do not

result in script termination.
3. Fatal errors: These are critical errors - for example, instantiating an object of a non-
existent class, or calling a non-existent function. These errors cause the immediate
termination of the script, and PHP's default behaviour is to display them to the user when
they take place.

What is meant by nl2br()?

nl2br — Inserts HTML line breaks before all newlines in a string string nl2br (string);
Returns string with ‘’ inserted before all newlines. For example: echo nl2br("god blessn
you") will output "god bless n you" to your browser.

How can we get second of the current time using date function?

$second = date("s");

What is the difference between the functions unlink and unset?

unlink() deletes the given file from the file system.
unset() makes a variable undefined.

How can we increase the execution time of a php script?

Set max_execution_time variable in php.ini file to your desired time in second.

How many ways can we get the value of current session id?

session_id() returns the session id for the current session.

How can we destroy the session, how can we unset the variable of a session?

session_unregister — Unregister a global variable from the current session
session_unset — Free all session variables

How can we destroy the cookie?

Set the cookie in past

How many ways we can pass the variable through the navigation between the pages?

GET or QueryString and POST

What is the difference between ereg_replace() and eregi_replace()?

eregi_replace() function is identical to ereg_replace() except that this ignores case
distinction when matching alphabetic characters.eregi_replace() function is identical to

ereg_replace() except that this ignores case distinction when matching alphabetic
characters.

How can we know the count/number of elements of an array?

2 ways
a) sizeof($urarray) This function is an alias of count()
b) count($urarray)

interestingly if u just pass a simple var instead of a an array it will return 1.

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 is meant by PEAR in php?

Answer1:
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"
Answer2:
PEAR is short for "PHP Extension and Application Repository" and is pronounced just
like the fruit. The purpose of PEAR is to provide:
A structured library of open-sourced code for PHP users
A system for code distribution and package maintenance
A standard style for code written in PHP
The PHP Foundation Classes (PFC),
The PHP Extension Community Library (PECL),
A web site, mailing lists and download mirrors to support the PHP/PEAR community
PEAR is a community-driven project with the PEAR Group as the governing body.

What does a special set of tags <?= and ?> do in PHP?

The output is displayed directly to the browser.
How To Protect Special Characters in Query String?
If you want to include special characters like spaces in the query string, you need to
protect them by applying the urlencode() translation function.

mysql_fetch_row() -> Fetch a result set as a regular array(). What’s the difference between htmlentities() and htmlspecialchars()? htmlspecialchars only takes care of <. >. no time limit is imposed. mysql_fetch_object(). and 25 seconds into script execution a call such as set_time_limit(20) is made. mysql_fetch_row()? mysql_fetch_array() -> Fetch a result row as a combination of associative array and regular array. How to set cookies? setcookie('variable'. The default limit is 30 seconds or.ini. the script returns a fatal error. set_time_limit() restarts the timeout counter from zero. This session_start() is always declared in header portion. If this is reached. unset() is a function for variable management. single quote ‘. What are the differences between mysql_fetch_array(). double quote " and ampersand. the max_execution_time value defined in the php.name of the cookie variable . It will simply delete the file in context. How can we increase the execution time of a php script? By the use of void set_time_limit(int seconds) Set the number of seconds a script is allowed to run. htmlentities translates all occurrences of character sequences that have different meaning in HTML. If seconds is set to zero. It will make a variable undefined. mysql_fetch_object() -> Fetch a result row as an object. if the timeout is the default 30 seconds.What is the difference between the functions unlink and unset? unlink() is a function for file system handling. When called. In other words. if it exists. it always declares first.'value'. then we write session_register(). variable . The hash is a 32-character hexadecimal number. the script will run for a total of 45 seconds before timing out. How can we know that a session is started or not? A session starts by session_start() function.'time'). What is the functionality of MD5 function in PHP? string md5(string) It calculates the MD5 hash of a string.

$i. // already expired time Reset a cookie by specifying its name only Example: setcookie('Test'). which are assigned to specific object fields at creation time.value . where a constructor could make the connection to the database while the destructor closes it. what about ob_start and ob_flush? ob_start is used to start the output buffer ob_flush is used to refresh or clear the output buffer xplain Constructors and Destructors in php? __construct( ) Called when instantiating an object __destruct( ) Called when deleting an object Constructors and destructors are functions that are called when a new instance of an object is created (constructors) and/or destroyed (destructors). Test . ?> In PHP 5.Class constructors can call on other constructors.value of the variable 'Test' time()+3600 .cookie variable name $i . only constructors were available and were created by defining a function whose name was the same as the class itself: <?php class MyClass { function MyClass($param) { echo "Created a new instance of MyClass !". Their primary purpose is to allow for a means to initialize and clean up after an object during its use. Constructors can call class methods or other functions.constructors are intuitively useful for initializing class properties.Constructors can accept parameters. PHP 4 Constructors In PHP 4. this concept has been changed PHP 5 or (5>=) now uses a unified constructor . including those from the class parent.time()+3600).time()-3600).denotes that the cookie will expire after an one hour How to reset/destroy a cookie Reset a cookie by specifying expire time in the past: Example: setcookie('Test'.One classic example is a class to access a database back end. } } $Myinstance = new MyClass.$i.expiry time Example: setcookie('Test'.value of the cookie variable time .

must-revalidate. pre-check=0 Pragma: no-cache what are the advantages of storing sessions in database? If you store a session in a database you have several advantages: @ Improving the security because on many hosting packages (shared host) PHP uses the same path for storing sessions for all the users. PHP still takes care of generating and propagating the session identifier. private.variables and functions (called methods). The real beauty of this approach is that you don't have to modify your code or the way you use sessions in any way. you can store all the session data in one database. somewhere that is not in your folders. @ For application that are running on multiple servers. PHP 5 supports public. How PHP Supports Encapsulation? Encapsulation is the mechanism that binds together code and data it manipulates and keeps both safe from out side interference and miss use . } } $Myinstance = new MyClass("value").To implement this concept . } function __destruct() { echo "Destroyed this instance of MyClass". $_SESSION still exists and behaves the same way. PHP 5 or (5>=) also uses a unified __destruct() method for its destructors. How many HTTP headers will send to a web page(client side) from server when you use sessions (session_start()) in php ? There are three HTTP headers included in the response: Expires: Thu. ?> Define class in php? A class is a blueprint of an object . 19 Nov 1981 08:52:00 GMT Cache-Control: no-store. and protected variables and member functions . and . PHP 5 Constructors and Destructors <?php class MyClass { function __construct($p) { echo "Created a new instance of MyClass!". post-check=0. no-cache.function named __construct(). @ You can track who is online etc.

// output that will be stored in the buffer $codlib = ob_get_contents(). Writing session data 5. ?> When I try to connect to mysql from php I get this error: "Call to unsupported or undefined function mysql_connect(). Reading session data 4. in the top of all the scripts that use mysql.changes made to session configuration directives still apply. but you can define the functions themselves anywhere. and it takes six arguments. echo $codlib. Opening the session data store 2. (on windows). But it is recomended to compile php with mysql. Closing the session data store 3. Destroying all session data 6. Cleaning out old session data How to capture content from the output buffer ? or Give me an example for Output caching in php? <?php ob_start(). 1. ?> O/p ***** This is not from the codlib buffer!!!!!!!! This text is from the codlib buffer******* Which function in PHP gives us absolute path of a file on the server? <?php $p = getcwd(). You must call session_set_save_handler() prior to calling session_start(). All you have to do is call this one function. (on unix) dl("mysql.so"). // start an output buffer echo ‘This text is from the codlib buffer*******<br />’. .dll"). // store buffer content in $w3buffer variable ob_end_clean()." Either you are missing mysql support in the php module or you need to load mysql dynamicly in your scripts by inserting: dl("mysql. The function is called session_set_save_handler(). // stop and clean the output buffer echo ‘This is not from the codlib buffer!!!!!!!!<br />’. echo $p.

if (!$socket) $Result["errno"] = $errno. return $Result. 128).curl_exec ($ch). Here is an example : <? // Generate the request header $ReqHeader = "POST $URI HTTP/1. curl_setopt($ch. &$errstr).n". ?> . CURLOPT_POST.mysite. $ReqHeader). "Data1=blah&Data2=blah"). curl_setopt($ch.php". fputs($socket. ?> This will have the net effect of posting your data to the $URL site."https://$URL"). while (!feof($socket)) $Result[$idx++] = fgets($socket.haxx.se).1n". 1).You can also do other nifty things with cURL. "$ReqBodyn". // Open the connection to the host $socket = fsockopen($Host. curl_setopt($ch. } //------------------------------------------- ?> Or you can use the cURL extensions for PHP (http://curl. like retrieve the HTML into variables and scrape through it for neat functionality. "Host: $Hostn". "Content-Type: application/x-www-form-urlencodedn". curl_close ($ch). echo "</script>". How do I insert javascript in php code? You just echo / print the javascript like you would do with html. Once you build it and compile their support into PHP. like: <? echo "<script language="JavaScript">n". 80. &$errno. it is fairly easy to do posting stuff (even over https): <? $URL="www. } $idx = 0. CURLOPT_URL. echo "alert("javascript from php"). without any header hacking. $ch = curl_init().How can I send variables from a PHP script to another URL using POST without using forms and hidden variables? You can open an HTTP socket connection and send HTTP POST commands.com/test. CURLOPT_POSTFIELDS. $Result["errstr"] = $errstr. "Content-Length: $ContentLengthnn".

100). The '. As an alternative you can use mt_rand which should generate more random." So the proper code would be: srand((double)microtime()*1000000). The files have names that begin with the table name and have an extension to indicate the file type. ?> Can I get the screen resolution and like with php? The quick answer is no. The index file has a '. The data file has a '. .100). thats because that information is sent with the initial HTTP headers upon requst to the server. PHP is a serverside scripting language and therefor has nothing to do with the type of a specific client. numbers. ?> How to output a number with leading zero's? <? $number = 15. But I dotn get random numbers. if you read the man page for rand carefully you will find a line that states: "Remember to seed the random number generator before use with srand(). So if you want client information that's not sent with the HTTP header you must a client scripting language like javascript. $number). MYSQL What these files contains? In MySql. Why doesn't rand give random numbers? I use the following code $iRandom = rand(0. the default table type is MyISAM. $iRandom = rand(0. Then you might ask "why can I then get the browser agent from php?". printf("%05d". then you are probably asking why can't I do that with php.MYI' (MYIndex) extension.MYD' (MYData) extension.How to count number of parameters given in URL by POST? <? echo count ($_POST). Each MyISAM table is stored on disk in three files. whats wrong? You have not RTFM'ed good enough.frm' file stores the table definition. OK here is a longer answer.

2346 How can increase the performance of mysql select query? In general. for time use SELECT CURTIME(). To help MySQL optimize queries better. Condition2: Delete the last row(having the field value 2345) and insert another row then What is the value for this auto incremented field user_pri_id In both cases let the value for auto increment field be n then next row will have value n+1 i. You can use the EXPLAIN statement to determine which indexes are used for a SELECT. How can we find the number of rows in a result set using php? $result = mysql_query($any_valid_sql. $database_link). How many ways we can we find the current date using mysql? SELECT CURDATE(). CURRENT_TIME() = CURTIME(). All references between different tables should usually be done with indexes. the first thing to check is whether you can add an index. $num_rows = mysql_num_rows($result). but if u r particular about no of rows with some special result do this >SELECT [colms]. The structure of table view buyers is as follows +—————-+————-+——+—–+———+—————-+ | Field | Type | Null | Key | Default | Extra | +—————-+————-+——+—–+———+—————-+ | user_pri_id | int(15) | | PRI | NULL | auto_increment | | userid | varchar(10) | YES | | NULL | | +—————-+————-+——+—–+———+—————-+ the value of user_pri_id the last row 2345 then What will happen in the following conditions Condition1: Delete all the rows and insert another row then What is the starting value for this auto incremented field user_pri_id . CURRENT_DATE() = CURDATE(). when you want to make a slow SELECT … WHERE query faster. This updates a value for each index .COUNT(*) FROM table_name [where u put conditions].How can we find the number of rows in a table using mysql? Use this for mysql >SELECT COUNT(*) FROM table_name. use ANALYZE TABLE or run myisamchk – analyze on a table after it has been loaded with data. echo "$num_rows rows found".e.

…. ORDER BY [col1]. What is the difference between GROUP BY and ORDER BY in Sql? To sort a result.part that indicates the average number of rows that have the same value. it may take a long time. it will create index row by row.[coln]. myisamchk –description –verbose shows index distribution information.[col2]. MySQL will do a repair of only the index tree.[coln]. What is the maximum length of a table name.[col2]. Tels DBMS to group results with same value of column col1. GROUP BY [col1]. To sort an index and data according to an index. and fieldname in mysql? Database name. AVG(col1) with it. use myisamchk –sort-index –sort- records=1 (if you want to sort on index 1). Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on. this is always 1. The most general way to satisfy a GROUP BY clause is to scan the whole table and create a new temporary table where all rows from each group are consecutive. (For unique indexes.…. use an ORDER BY clause. if you want to count all items in group. database name. SUM(col1). sum all values or view average How can we change the name of a table? MySQL query to rename table: RENAME TABLE tbl_name TO new_tbl_name [. Note that the first time you sort a large table this way. tbl_name2 TO new_tbl_name2] … or. ALTER TABLE tableName CHANGE OldName newName. If QUICK is given.64 Table name -64 Fieldname-64 . If EXTENDED is given.) MySQL will use this to decide which index to choose when you join two tables based on a non-constant expression. You can check the result from the table analysis by using SHOW INDEX FROM tbl_name and examining the Cardinality value. and then use this temporary table to discover groups and apply aggregate functions (if any). You can use COUNT(col1). 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. This is a good way to make queries faster if you have a unique index from which you want to read all records in order according to the index.

How can we encrypt and decrypt a data present in a mysql table using mysql? AES_ENCRYPT() and AES_DECRYPT() How can we know the number of days between two given dates using MySQL? Use DATEDIFF() SELECT DATEDIFF(NOW(). answer VARCHAR(1024)" . Write query for creating a table. SELECT CURRENT_TIME(). SELECT CURTIME(). question VARCHAR(80) NOT NULL" . How can we change the name of a column of a table? This will change the name of column: ALTER TABLE table_name CHANGE old_colm_name new_colm_name How can we change the data type of a column of a table? This will change the data type of a column: ALTER TABLE table_name CHANGE colm_name same_colm_name [new data type] Which clause is used to select unique records of the table? DISTINCT How would you select all the users. created_time TIMESTAMP DEFAULT sysdate()" .What are the other commands to know the structure of table using mysql commands except explain command? describe table_name. ". whose email address is null(empty)? . CREATE TABLE codlib_questions (" . ". ". SELECT CURRENT_DATE(). ". sort_order INTEGER" . ") How many ways we can we find the current date using MySQL? SELECT CURDATE(). " id INTEGER NOT NULL" .'2006-07-01').

+------+-------------+ | year | SUM(profit) | +------+-------------+ | 2000 | 4525 | | 2001 | 3010 | | NULL | 7535 | <<<.SELECT usrname FROM customers WHERE ISNULL(usremail). then start MySQL the time zone will be set to UK time. It does not move to 0 to prevent data losses. How many types of buffers does use MySQL? global buffers and per-connection buffers How can I set the time zone for MySQL to UK time? If you set the environment variable TZ=GB. I.E. SUM(profit) FROM sales GROUP BY year WITH ROLLUP. but further inserts are going to produce an error How do you prevent mysql from caching a query? SELECT SQL_NO_CACHE include this (SQL_NO_CACHE) in select query while you retrieve the data from mysql What is the Use of "WITH ROLLUP" in Mysql? Adding a WITH ROLLUP modifier to the GROUP BY clause causes the query to produce another row. What happens when the column is set to AUTO INCREMENT and we reach the maximum valuen for that table? It stops incrementing. what is the use of –i-am-a-dummy flag in MySql? It Makes the MySQL engine refuse UPDATE and DELETE commands where the WHERE clause is not present. eg: mysql> SELECT year.Note here*) is created by mysql and also we get total profit in the last column. (Linux only) bash:#TZ=GB bash:#export TZ .Note here* +------+-------------+ So an extra row (<<<.

can be detected Date and Time Handling How can we submit from without a submit button? we can use javascript for submitting the form. etc. Try du to see how much space is free/used JavaScript What is JavaScript? JavaScript is a platform-independent. In the data (normally var) directory. This will submit the form. etc ) document. The user's browser. interpreted client-side scripting and programming language developed by Netscape Communications Corp. The user can be given control over the browser like User input validation Simple computations can be performed on the client's machine.submit().myform. I am trying to create a database and keep getting an error :.cnf. onfocus. OS.event-driven.(Errcode: 28) errcode: 28 No space left on device This means that you are out of disk space.bash:#mysqld & You can also set environment variables in my. screen size. Trigger the JavaScript code on any event ( like onselect of drop down list box. and Sun Microsystems. What can javascript programs do? Generation of HTML pages on-the-fly without accessing the Web server. CSS What are the advantages and disadvantages of CASCADE STYLE SHEETS? External Style Sheets Advantages Can control styles for multiple documents at once Classes can be created for use on multiple HTML element types in many documents Selector and grouping methods can be used to apply styles under complex contexts Disadvantages An extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded .

One can re-use same set of CSS styles over number of pages throughout the website to keep a consistent look and feel.g. Class selectors name in CSS is preceded by full stop. E. What is CLASS selector? Using CLASS selectors in CSS one can assign style information to all elements. What is the cascading order of a CSS style sheet? Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules. unless defined separately. define styles (look and feel) for the content that HTML holds. The class selectors which can be applied multiple times to different element within a page to format content. Stylesheets help web designers keep the HTML clean and separate styles from the content.Becomes slightly unwieldy for small quantities of style definitions Embedded Style Sheets Advantages Classes can be created for use on multiple tag types in the document Selector and grouping methods can be used to apply styles under complex contexts No additional downloads necessary to receive style information Disadvantages This method can not control styles for multiple documents at once Inline Styles Advantages Useful for small quantities of style definitions Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods Disadvantages Does not distance style information from content (a main goal of SGML/HTML) Can not control styles for multiple documents at once Author can not create or control classes of elements to control multiple element types within the document Selector grouping methods can not be used to create complex element addressing scenarios What are Style Sheets? Stylesheets. as the name suggest. where number four has the highest priority: . by default all the elements in the HTML document will inherit this property. What is the importance of Cascade in CSS? One doesn't have to declare repeating styles for the child elements. if <body> has a font-name style set to Arial.

Where the browser breaks the line depends on the size of the browser window. an inline style (inside an HTML element) has the highest priority. Some of the at-rule in CSS are '@import'. which means that it will override a style declared inside the <head> tag. What are the two parts of CSS declaration? Property and value What is at-rule in CSS? The at-rule in CSS begins with the at-keyword. It is then followed by '@' character and then the identifier. Note: The "first-line" pseudo-element can only be used with block-level elements. Note: The following properties apply to the "first-line" pseudo-element: * font properties * color properties * background properties * word-spacing * letter-spacing * text-decoration * vertical-align * text-transform * line-height * clear . in an external style sheet. 1. External style sheet 3. What are the types of CSS rules? There are three types of CSS rules. or in a browser (a default value). '@page'. Inline style (inside an HTML element) So. Browser default 2. They are namely: HTML Selector Class and ID waht is first-line pseudo-element? The "first-line" pseudo-element is used to add special styles to the first line of the text in a selector: p {font-size: 12pt} p:first-line {color: #FF0000.font-variant:small-caps} <p>Some text that ends up on two or more lines</p> In the example above the browser displays the first line formatted according to the "first- line" pseudo element. Internal style sheet (inside the <head> tag) 4.

How will you add Styles to Elements with Particular Attributes? You can also apply styles to HTML elements with particular attributes. The id selector is defined as a #. A Selector is the portion of a Rule-Set that comes before the style Declaration Block embedded within curly braces ('{' and '}'.article:first-line {color: #FF0000} <p class="article">A paragraph in an article</p> The example above will set the first line of all paragraphs with class="article" to red. Aural presentation can be used: * by blind people . instead of reading information.) How will you apply more than one class per given element? To apply more than one class per given element. The style rule below will match the element that has an id attribute with a value of "green": #green {color: green} The style rule below will match the p element that has an id with a value of "para1": p#para1 { text-align: center. color: red } Waht is Aural Style Sheets? Aural style sheets use a combination of speech synthesis and sound effects to make the user listen to information. a 'Selector' is used to specify the portion of the document tree that the style declaration that follows will be attached to. </p> The paragraph above will be styled by the class "center" AND the class "bold".Pseudo-elements can also be combined with CSS classes: p. The style rule below will match all input elements that have a type attribute with a value of "text": input[type="text"] {background-color: blue} How will you define styles for HTML elements with the id selector? You can define styles for HTML elements with the id selector. what is selector? In the CSS Rule-Set syntax. the syntax is: <p class="center bold"> This is a paragraph.

Which ever key is help us to identify a record uniquely in a database table is called primary key. An example of an Aural style sheet: h1. then speak the headers in a very rich male voice.au") } The example above will make the speech synthesizer play a sound. What is primary Key? The primary key of a relational table uniquely identifies each record in the table. in Microsoft SQL Server). What's a Database Abstraction Layer? Abstraction is a technique which simplifies something complex. Note: Creating a query join will not establish a permanent relationship between the tables. It can either be a normal attribute that is guaranteed to be unique (such as Social Security Number in a table with no more than one record per person) or it can be generated by the DBMS (such as a globally unique identifier. It does this by removing non-essential parts of the object. allowing us to concentrate on the important parts. cue-before: url("beep. or GUID. the complexities of connecting to a database is hidden behind a standard API. Database tables that are joined in a query are related in that query only. Primary keys may consist of a single attribute or multiple attributes in combination. h3. * to help users learning to read * to help users who have reading problems * for home entertainment * in the car * by print-impaired communities The aural presentation converts the document to plain text and feed this to a screen reader (a program that reads all the characters on the screen). The type of join that you use indicates which records the query will select or perform the chosen actions on. h4 { voice-family: male. thereby allowing the programmer to connect to many different . Database What is Query Joins? A join is a temporary relationship that you can create between two tables in a database query that do not already have an established relationship or common field with the same fieldname or data type. h2. In the case of database abstraction. and nowhere else. richness: 80.

. shopping carts. Components that manage dates. objects can easily be modified and added to a system there by reducing maintenance costs. First Normal Form The First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. but dependant on another value in the table object-oriented-programming What are the features and advantages of OBJECT ORIENTED PROGRAMMING? One of the main advantages of OO programming is its ease of modification. a piece of code that manages the date). so that a change in programming can affect any code that follows it. For some systems. but the last two are mainly academic and will not be discussed). Second Normal Form Where the First Normal Form deals with redundancy of data across a horizontal row. If a function is used multiple times in a system (i. As stated earlier. It allows for more complicated and flexible interactions.e.e. We want to ensure that there is no duplication of data in a given row. Explain Normalization concept? The normalization process involves getting our data to conform to three progressive normal forms. the normal forms are progressive. Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. and that every column stores the least amount of information possible (making the field atomic). it is often simply cut and pasted into each program (i. What are the differences between PROCEDURE ORIENTED LANGUAGES and OBJECT ORIENTED LANGUAGES? Traditional programming has the following characteristics: Functions are written sequentially. OO programming is also considered to be better at modeling the real world than is procedural programming.types of databases without relearning the methods and syntax peculiar to each different type. order . a change log. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns. an OO approach can speed development time since many objects are standard across systems and can be reused. shipping. your tables must already be in First Normal Form.. can be purchased and easily modified for a specific system. Third Normal Form In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key. and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms. so to achieve Second Normal Form. etc.

determines if it is a business day or a holiday. an object may be created around "date") The object would contain all information and functionality for that thing (A date object it may contain labels like January. Code (sequences of computer instructions) and data (information on which the instructions operates on) are kept separate. "instance". modified. which do not require object initialization. a request is sent asking for specific information. February. a report object may need to know what today’s date is and will send a request to the date object) These requests are called messages and each object has an interface that manages messages. One set of code may rely on data in multiple places. What is the use of friend function? Sometimes a function is best shared among a number of different classes.. etc). .e. a global function or member function of another class provides the match. "inheritance". See Fig. Multiple sets of code can access and modify one set of data.function. Y2K when the code needed to be changed to handle four numerical digits instead of two).. Multiple sets of code and data are required to work together. When one object needs information from another object. If a date change is needed (i. In either case they can be set to be friends of other classes. The information within an object is encapsulated (or hidden) from the rest of the system. etc. by using a friend specifier in the class that is admitting them. order processing. 1). Tuesday.. those. etc. date function. OO programming languages include features such as "class". Wednesday.e. Changes made to any of the code sets and data sets can cause problems through out the system. Such functions can be declared either as member functions of one class or as global functions. mylinkage * next..A system is composed of multiple objects (i. reports. as if they were themselves members of that class. fulfillment system. information about a particular thing should reside in only one place in a system. i. See Fig 2). class mylinkage { private: mylinkage * prev. Object-Oriented programming takes a radically different approach: Code and data are merged into one indivisible item – an object (the term "component" has also been used to describe an object. but instead of requiring an implementation with the name of that class attached by the double colon syntax. Such functions can use all attributes of the class whichnames them as a friend. and "polymorphism" that increase the power and flexibility of an object. and tested. What’s the difference between accessing a class method via -> and via ::? :: is allowed to access methods that can perform static operations. Ideally.A friend declaration is essentially a prototype for a member function.e. It may contain functionality that manages leap years. all these pieces of code must be found.) An object is an abstraction of a set of real-world things (for example. (for example.

} void set_prev(mylinkage * L. }. class B { int f1(). }. XML Describe the differences between XML and HTML? XML HTML User definable tags Defined set of tags designed for web display Content driven Format driven End tags required for well formed End tags not required documents Quotes required around attributes Quotes not required values Slash required in empty tags Slash not required . }. Friend functions allow binary operators to be defined which combine private data in a pair of objects. We will return to it when we look at overloading. void mylinkage::set_next(mylinkage* L) { next = L. mylinkage * N ) { N->prev = L. void set_next(mylinkage* L). It is also possible to specify all the functions in another class as friends. } Friends in other classes It is possible to specify a member function of another class as a friend as follows: class C { friend int B::f1(). mylinkage(). mylinkage * pred(). public: mylinkage * succ(). class A { friend class B. }. This is particularly powerful when using the operator overloading features of C++. protected: friend void set_prev(mylinkage* L. by specifying the entire class as a friend. mylinkage* N).

* XML stands for EXtensible Markup Language * XML is a markup language much like HTML * XML was designed to describe data * XML tags are not predefined. The user cannot see the script's source code (unless the author publishes the code separately). It is not a fixed set of elements like HTML. What is mean by server-side scripting? Server-side scripting is a web server technology in which a user's request is fulfilled by running a script directly on the web server to generate dynamic HTML pages. it is like SGML (Standard Generalized Markup Language) in that it is a metalanguage. The online payment gateway allows you to immediately verify credit card transactions and authorize funds on a customer's credit card directly from your Web site. By default. but rather. You should decide when to use temporary cookies and when to use persistent . The documents produced by server-side scripts may. and may not even be aware that a script was executed. server-side scripts are executed by the web server when the user requests a document. which is then sent to the user's computer.What is XML? XML (Extensible Markup Language) is a standard for creating markup languages which describe the structure of data. contain client-side scripts. cookies are created as temporary cookies which stored only in the browser's memory. They produce output in a format understandable by web browsers (usually HTML). of course. or a language for describing languages. commonly referred to as transaction batching. XML enables authors to define their own tags. temporary cookies will be erased. When the browser is closed. It then passes the transaction off to your merchant bank for processing. It is usually used to provide interactive web sites that interface to databases or other data stores. What Is a Persistent Cookie? A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. You must define your own tags * XML uses a Document Type Definition (DTD) or an XML Schema to describe the data * XML with a DTD or XML Schema is designed to be self-descriptive * XML is a W3C Recommendation General Web What is online payment gateway? An online payment gateway is the interface between your merchant account and your Web site.

When browser sees such header it shows the data as it would be a file (for example image) Some examples of MIME types: audio/x-ms-wmp image/png aplication/x-shockwave-flash Answer 2: Multipurpose Internet Mail Extensions. The initials "RSS" are used to refer to the following formats: * Really Simple Syndication (RSS 2.cookies based on their differences: * Temporary cookies can not be used for tracking long-term information.90) * Rich Site Summary (RSS 0. "web feed". * Temporary cookies are safer because no programs other than the browser can access them. What is meant by MIME? Answer 1: MIME is Multipurpose Internet Mail Extensions is an Internet standard for the format of e-mail.91) . The reader checks the user's subscribed feeds regularly for new content. An RSS document.0 and RSS 0. The user subscribes to a feed by entering the feed's link into the reader or by clicking an RSS icon in a browser that initiates the subscription process. or "channel". However browsers also uses MIME standard to transmit files. known colloquially as "Really Simple Syndication") is a family of Web feed formats used to publish frequently updated content such as blog entries. This information is incorporated into Web server and browser software.0) * RDF Site Summary (RSS 1. WWW's ability to recognize and handle files of different types is largely dependent on the use of the MIME (Multipurpose Internet Mail Extensions) standard. The standard provides for a system of registration of file types with information about the applications needed to process them. news headlines or podcasts. * * Persistent cookies are less secure because users can open cookie files see the cookie values. "feed reader" or an "aggregator". downloading any updates that it finds. and enables the automatic recognition and display of registered file types. RSS content can be read using software called an "RSS reader". * Persistent cookies can be used for tracking long-term information. … What is RSS and why it is Important? RSS (formally "RDF Site Summary". MIME has a header which is added to a beginning of the data. which is called a "feed". RSS makes it possible for people to keep up with their favorite web sites in an automated manner that's easier than checking them manually. contains either a summary of content from an associated web site or the full text.

which is referenced by the document (or documents) that use it. enabling web pages to be scripted. * The ability to track and manage multiple versions of a single instance of content. * The ability to publish the content to a repository to support access to the content. or other variables. By viewing the file that contains the script. e. * Definition of the content workflow tasks. by the user's web browser. clicks a certain button.what is mean by Client-side scripting? Client-side scripting generally refers to the class of computer programs on the web that are executed client-side. technical manuals. image media. which is based on several standards: Client-side scripts are often embedded within an HTML document. and publishing industry-specific documentation such as news articles. . A web content management system is a content management system with additional features to ease the tasks required to publish web content to web sites. including any visible output from the script. or layouts. but they may also be contained in a separate file.Web authors write client-side scripts in languages such as JavaScript (Client-side JavaScript). environmental conditions (such as the time of day). instead of server-side (on the web server). sales guides. what is mean by Content management system(CMS)? A content management system (CMS) is a system used to manage the content of a Web site. Client-side scripts may also contain instructions for the browser to follow if the user interacts with the document in a certain way. users may be able to see its source code.g. Web content management systems are often used for storing. The user's web browser executes the script. then displays the document. Many web authors learn how to write client-side scripts partly by examining the source code for other authors' scripts. A content management system may support the following features: * only of documents and multimedia material * Identification of all key users and their content management roles * The ability to assign roles and responsibilities to different content categories or types. that is. the necessary files are sent to the user's computer by the web server (or servers) on which they reside. though they may require such communication. fonts. controlling. Increasingly. as well as over the web. and marketing brochures. Upon request. For example the CMS may automatically set default color. audio files.The content managed includes computer files. operators' manuals.[1] Content management systems are deployed primarily for interactive use by a potentially large number of contributors. electronic documents and web content. These instructions can be followed without further communication with the server.. * Some content management systems do allow the textual aspect of content to be separated to some extent from formatting. to have different and changing content depending on user input. versioning. often coupled with event messaging so that content managers are alerted to changes in content. This type of computer programming is an important part of the Dynamic HTML (DHTML) concept. and incorporates enterprise search and retrieval. the repository is an inherent part of the system. The idea behind a CMS is to make these files available inter-office.

the method should be POST. How the form data is transmitted? quotation from the HTML 4. =========================================== What are the differences between Get and post methods in form submitting. The user agent then traverses the link to this URI.0 specification says. encoded using the application/x-www-form-urlencoded content type. a mashup is a web application that combines data from more than one source into a single integrated tool.0 specification –> If the method is “get” .what is a mashup? Mashups are an exciting genre of interactive Web applications that draw upon content retrieved from external data sources to create entirely new and innovative services. then the form method should be GET. give the case where we can use get and we can use post methods? When to use GET or POST The HTML 2. the user agent takes the value of action. – –>If the service associated with the processing of a form has side effects (for example. then appends the form data set. Templates for web pages work much like templates in Microsoft Word. an example is the use of cartographic data from Google Maps to add location information to real-estate data from Craigslist. They are a hallmark of the second generation of Web applications informally known as Web 2. In this scenario. Quote from CGI FAQ . –> If the method is “post” –. or any other word processing application. Many database searches have no visible side-effects and make ideal applications of query forms. appends a ? to it. it has no lasting observable effect on the state of the world). form data are restricted to ASCII codes. modification of a database or subscription to a service). the user agent conducts an HTTP post transaction using the value of the action attribute and a message created according to the content type specified by the enctype attribute.-.0. thereby creating a new and distinct web service that was not originally provided by either source.0 specification repeats this with minor stylistic changes): –>If the processing of a form is idempotent (i.e. in section Form Submission (and the HTML 4. What is a template? A template is a framework for web pages and sites. In technology. A mashup is a website or application that combines content from more than one source into an integrated experience.

particularly if cacheing is disabled (as is usually the case with CGI output). And GET when it does not matter. mysql_fetch_row. Browsers may reload a GET URL automatically. two or more identical requests will have no further effect.I would prefer POST when I don’t want the status to be change when user resubmits. take the following example. Who is the father of PHP and explain the changes in PHP versions? Rasmus Lerdorf is known as the father of PHP. such as querying a database. you are well-advised to use POST in any case.0 and is a lot nicer. You can even built a timer function where you can automatically submit the form after xx seconds once the loading is done (can be seen in online test sites). counter increments. onchange events of different inputs and perform the form submission. You can attach the document.0 is an early and no longer supported version of PHP. PHP 3 is the successor to PHP/FI 2. mysql_fetch_array 3. This means you’re far less likely to get inadvertently-repeated entries from POST.”. Indirectly. which uses the Zend engine under the hood. PHP 4 is the current generation of PHP. but will typically prompt the user before re-submitting a POST request. potentially resulting in two identical database or guestbook entries. and not by their offsets (numbers are illegal property names). But the $$message is not a very familiar face.$message = “Mizan”. an identical request will be sent to the server. etc. If a user hits “reload” on his/her browser.$message is a simple PHP variable that we are used to.$$message = “is a moderator of PHPXperts. PHP 5 uses Zend engine 2 which. In how many ways we can retrieve the data in the result set of MySQL using PHP? You can do it by 4 Ways 1. mysql_fetch_assoc What is the difference between mysql_fetch_object andmysql_fetch_array? mysql_fetch_object() is similar tomysql_fetch_array(). break it . though it matters little if you’re using a form. What is the difference between $message and $$message? It is a classic example of PHP’s variable variables. There is a further practical constraint that many systems have built-in limits to the length of a GET request they can handle: when the total size of a request (URL+params) approaches or exceeds 1Kb. instead of an array.PHP/FI 2. This means that whereas one GET request might (rarely) change some state on the Server. GET is (in theory) the preferred method for idempotent operations. among other things.” assigned.formname. mysql_fetch_object 4. GET requests should always be idempotent on the server. It creates a variable name $mizan with the value “is a moderator of PHPXperts.submit() method to onclick. that means that you can only access the data by the field names.Firstly. offers many additionalOOP features How can we submit a form without a submit button? The main idea behind this is to use Java script submit() function in order to submit the form without explicitly clicking any submit button. with one difference -an object is returned. 2. the the HTTP protocol specifies differing usages for the two methods.This is a theoretical point which is also good advice in practice.

How can I execute a PHP script using command line? . variable value reassignments. INNO DB 5. What are the different tables present in MySQL. etc. Functions in IMAP. Heap 3. variable value reassignments.require_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script. This is a behavior similar to the include() statement.include_once and require_once? The include() statement includes and evaluates the specified file.+)$/”.com’ using regular expression of PHP? preg_match(”/^http:\/\/.PHP”) two times in a PHP page “makeit. How can we create a database using PHP and MySQL? We can create MySQL database with the use of mysql_create_db(“Database Name”) What are the differences between require and include. Merge 4. include() does not behave this way. That is.ename varchar(10)) ? Total 5 types of tables we can create 1.23 and as a result if we do not specify the table name explicitly it will be assigned to the default engine.The include_once() statement includes and evaluates the specified file during the execution of the script. etc.com’. use require() if you want a missing file to halt processing of the page. The two constructs are identical in every way except how they handle failure.PHP”? Yes we can use include() more than one time in any page though it is not a very good practice. and you want to be sure that it is included exactly once to avoid problems with function redefinitions. include() produces a Warning while require() results in a Fatal Error. and you want to be sure that it is included exactly once to avoid problems with function redefinitions. Can we use include (”abc. MyISAM 2. In other words. it will not be included again. the script will continue regardless. echo $found[1].like this${$message} => $mizanSometimes it is convenient to be able to have variable variable names. POP3 AND LDAP? You can find these specific information in PHP Manual.$found).+@(. it will be included just once.The documentation below also applies to require().com ‘ from a string ‘http://info@abc.include_once() should be used in cases where the same file might be included and evaluated more than once during a particular execution of a script.’http://info@abc. How can we extract string ‘abc. As the name suggests. a variable name which can be set and used dynamically. which type of table is generated when we are creating a table in the following syntax: create table employee (eno int(2). with the only difference being that if the code from a file has already been included. ISAM MyISAM is the default storage engine as of MySQL 3.

3. are low level binary instructions. Developed by Zeev Suraski and Andi Gutmans.As of version 4.? We can find the detail documentation about different paypal integration process at the following site PayPal PHP SDK : http://www. In the early days of PHP4. PHP supports a new SAPI type (Server Application Programming Interface) named CLI which means Command Line Interface. how can we configure Paypal.paypaldev. Opcodes. there are a multitude of products and techniques to help you speed up this process. we show the how modern .etc. For example: echo nl2br(”god bless\n you”) will output “god bless <br /> you” to your browser.php”.org What is meant by nl2br()? Inserts HTML line breaks (<BR /&gt before all newlines in a string string nl2br (string). the Zend Engine is an abbreviation of their names. Returns string with ” inserted before all newlines.Be aware that if your PHP script was written for the Web CGI interface. assuming “php” is the command to invoke the CLI program.Today.e. In the following diagram. Draw the architecture of Zend engine? The Zend Engine is the internal compiler and runtime engine used by PHP4. Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. “php myScript. short for operation codes.it may not execute properly in command line environment. The opcode was flushed from memory after execution. For example. Then the opcode was executed and the HTML generated sent to the client. it worked as follows: The PHP script was loaded by the Zend Engine and compiled into Zend opcode. Shopping cart online validation i.0.

net.apache.php. Apache is a better server that IIS both in functionality and security. and MySQL? As of February.2. PHP Scripts are loaded into memory and compiled into Zend opcodes. PHP is more faster that asp or any other scripting language.PHP) instead of combination of other software programs. 2007 the current versions are PHP: php5.com/downloads/mysql/.mysql.2. Security of Linux is very very more than windows. MySQL is world most popular open source database. MySQL. How can we encrypt and decrypt a data present in a MySQL table using MySQL? AES_ENCRYPT () and AES_DECRYPT () How can we encrypt the username and password using PHP? The functions in this section perform encryption and decryption.4 Note: visit www.2. servers and operating systems? All of those are open source resource. What are the current versions of apache. all the shaded boxes are optional. apache. and compression and uncompression: encryption decryption AES_ENCRYT() AES_DECRYPT() ENCODE() DECODE() DES_ENCRYPT() DES_DECRYPT() ENCRYPT() Not available MD5() Not available OLD_PASSWORD() Not available PASSWORD() Not available SHA() or SHA1() Not available Not available UNCOMPRESSED_LENGTH() What are the features and advantages of object-oriented programming? .1 MySQL: MySQL 5.org to get current versions. What are the reasons for selecting lamp (Linux. http://dev. PHP. www.PHP scripts work.Apache: Apache 2.

One set of code may rely on data in multiple places. Such functions can use all attributes of the class which names them as a friend. When one object needs information from another object. an object may be created around “date”) The object would contain all information and functionality for that thing (A date object it may contain labels like January.. 1).If a date change is needed (i. See Fig. it is often simply cut and pasted into each program (i. reports. What is the use of friend function? Sometimes a function is best shared among a number of different classes.It may contain functionality that manages leap years. etc. by using a friend specifier in the class that is admitting them. OO programming is also considered to be better at modeling the real world than is procedural programming. shopping carts. modified.The information within an object is encapsulated (or hidden) from the rest of the system. February. etc.e. In either case they can be set to be friends of other classes. etc. but instead of requiring an implementation . order function. Changes made to any of the code sets and data sets can cause problems through out the system.(for example. Ideally. date function.e.) An object is an abstraction of a set of real-world things (for example. all these pieces of code must be found... determines if it is a business day or a holiday. etc). If a function is used multiple times in a system (i. so that a change in programming can affect any code that follows it. information about a particular thing should reside in only one place in a system. a report object may need to know what today’s date is and will send a request to the date object) These requests are called messages and each object has an interface that manages messages. an OO approach can speed development time since many objects are standard across systems and can be reused.. a change log.e. See Fig 2). It allows for more complicated and flexible interactions.. fulfillment system.OO programming languages include features such as “class”.A friend declaration is essentially a prototype for a member function.order processing.For some systems. Such functions can be declared either as member functions of one class or as global functions.Object-Oriented programming takes a radically different approach:Code and data are merged into one indivisible item – an object (the term “component” has also been used to describe an object. can be purchased and easily modified for a specific system What are the differences between procedure-oriented languages and object-oriented languages? Traditional programming has the following characteristics:Functions are written sequentially.One of the main advantages of OO programming is its ease of modification. Wednesday. Components that manage dates. “instance”. Y2K when the code needed to be changed to handle four numerical digits instead of two). and tested. Multiple sets of code and data are required to work together. a request is sent asking for specific information. as if they were themselves members of that class. objects can easily be modified and added to a system there by reducing maintenance costs. shipping. a piece of code that manages the date). and “polymorphism” that increase the power and flexibility of an object.e.A system is composed of multiple objects (i. Tuesday.“inheritance”.. Multiple sets of code can access and modify one set of data. OO systems are also easier for non-technical personnel to understand and easier for them to participate in the maintenance and enhancement of a system because it appeals to natural human cognition patterns.Code (sequences of computer instructions) and data (information on which the instructions operates on) are kept separate.

with the name of that class attached by the double colon syntax. 0. 1. By default. These errors cause the immediate termination of the script. Warnings: These are more serious errors .although.non-critical errors that PHP encounters while executing a script – for example. 31 Dec 1999 18:00:00 EST echo '<p>'.php. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. 2000). but they do not result in script termination.1. // Now generate the timestamp for that particular timezone. 3.naken./ What is the functionality of the function htmlentities? Convert all applicable characters to HTML entities. 2000 $stamp = mktime(8. accessing a variable that has not yet been defined. a global function or member function of another class provides the match. all characters which have HTML character entity equivalents are translated into these entities.for example. attempting to include() a file which does not exist.?> What is meant by urlencode and urldocode? URLencode returns a string in which all non-alphanumeric characters except -_. date(DATE_RFC1123. What are the different types of errors in PHP? Three are three types of errors: 1. Fatal errors: These are critical errors . 2. you can change this default behavior. By default. or calling a non-existent function. What are the differences between PHP 3 and PHP 4 and PHP 5? Please read the release notes at http://www.instantiating an object of a non- existent class.cc.for example. urldecode decodes any %## encoding in the given string. that is the same way as in application/x-www-form-urlencoded media type.net. as you will see. . 1. and PHP’s default behavior is to display them to the user when they take place. It is encoded the same way that the posted data from a WWW form is encoded. $stamp) . How can we convert the time zones using PHP? By using date_default_timezone_get and date_default_timezone_set function on PHP 5. 0. except with htmlentities(). Notices: These are trivial. you can search Google for that. How can we get second of the current time using date function? $second = date(”s”).'</p>'. // Output the date in a standard format (RFC1123). this will print: // Fri. these errors are displayed to the user.This function is identical to htmlspecialchars() in all ways. How can we convert asp pages to PHP pages? There are lots of tools available for asp to PHP conversion.0 <?php // Discover what 8am in Tokyo relates to on the East Coast of the US // Set the default timezone to Tokyo time: date_default_timezone_set('Asia/Tokyo'). // Now set the timezone back to US/Eastern date_default_timezone_set('US/Eastern'). on Jan 1st. such errors are not displayed to the user at all . the best one is available athttp://asp2php.

This is very useful if you just want to get a dump of the structure for a table! How can we optimize or increase the speed of a MySQL select query? • first of all instead of using select * from table1.What is the difference between the functions unlink and unset? unlink() deletes the given file from the file system.tbl_name…] FROM ‘/path/to/backup/directory’mysqldump: Dumping Table Structure and DataUtility to dump a database or a collection of database for backup or for transferring the data to another SQL server (not necessarily a MySQL server). ? To backup: BACKUP TABLE tbl_name[. -t. How many ways can we get the value of current session id? session_id() returns the session id for the current session. How can I know that a variable is a number or not using a JavaScript? . How many ways we can pass the variable through the navigation between the pages? • GET/QueryString • POST How can we know the count/number of elements of an array? 2 ways a) sizeof($urarray) This function is an alias of count() b) count($urarray) What is the PHP predefined variable that tells the What types of images that PHP supports? Though i am not sure if this is wrong or not. from table1 • Look for the opportunity to introduce index in the table you are querying. How can we destroy the session. • use limit keyword if you are looking for any specific number of rows from the result set. How can we take a backup of a MySQL table and how can we restore it. column3. With the exif extension you are able to work with image meta data.unset() makes a variable undefined. use select column1.. –no-create-infoDon’t write table creation information (the CREATE TABLE statement). column2.Don’t write any row information for the table. how can we unset the variable of a session? session_unregister — Unregister a global variable from the current session session_unset — Free all session variables How can we destroy the cookie? Set the cookie in past. The dump will contain SQL statements to create the table and/or populate the table. How can we register the variables into a session? $_SESSION[’name’] = “Mizan”.tbl_name…] TO ‘/path/to/backup/directory’ RESTORE TABLE tbl_name[. -d. –no-data.

Here is a nice solution of it.$db1).$db2). //this will failSo how to solve that? take a look below.”pwd”) mysql_select_db(”db2″. mysql_select_db(”db1″. $db2).$db1). List out the predefined classes in PHP? Directory stdClass __PHP_Incomplete_Class exception php_user_filter How can I make a script that can be bi-language (supports English. FALSE otherwise.$db1). $res2 = mysql_query(”query”.But you cannot execute new query in $db1.now the following query will execute successfully.Smart Draw How can I retrieve values from one database server and store them in other database server using PHP? we can always fetch from one database and rewrite to another. $res3 = mysql_query(”query”. Case Studio.so at this point the following script will fail $res3 = mysql_query(”query”. $db1).”pwd”. List out some tools through which we can draw E-R diagrams for mysql.”user”.At this point you can only fetch records from you previous ResultSet.”user”. $db1 = mysql_connect(”host”. on runtime choose the required language option. as we connect to the $db2 with this optional parameter set to ‘true’. $res2 = mysql_query(”query”. all the labels are putted in both language files as variables and assign those variables in the PHP source. So mysql_connect has another optional boolean parameter which indicates whether a link will be created or not.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number.i. German)? You can maintain two separate language file for each of the language. $res1 = mysql_query(”query”. $res1 = mysql_query(”query”. true) mysql_select_db(”db2″. Thanks goes to Hasan and Hasin for this solution.$db2). $db2 = mysql_connect(”host”. $db1).”pwd”).”pwd”) mysql_select_db(”db1″.e $res1 . $db1 = mysql_connect(”host”. $db2 = mysql_connect(”host”. even if you supply the link as because the link was overwritten by the new db.bool is_numeric ( mixed var) Returns TRUE if var is a number or a numeric string.”user”. so both link will remain live. What are the difference between abstract class and interface? .”user”. $db2).$db1).

How can we repair a MySQL table? The syntex for repairing a MySQL table is REPAIR TABLENAME. All the methods must be define by its implemented class. Maximum Length Identifier (bytes) Database 64 Table 64 Column 64 Index 64 Alias 255 There are some restrictions on the characters that may appear in identifiers: What are the other commands to know the structure of table using MySQL commands except explain command? describe Table-Name.Abstract methods are the methods. drop.We can grant rights on all databse by using *. As a result we can not send mails using JavaScript. ]. [TABLENAME. database name. and fieldname in MySQL? The following table describes the maximum length for each type of identifier. username@hostname . insert. which are declare in its class but not define.* or a specific table by database. Give the syntax of Grant and Revoke commands? The generic syntax for grant is as following > GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY [password] now rights can be a) All privileges b) combination of create.[Extended] This command will repair the table specified if the quick is given the MySQL will do a repair of only the index tree if the extended is given it will create index row by row What is the maximum length of a table name. this requires the client to approve it. update and delete etc.table_name username@hotsname can be either username@localhost. The definition of those methods must be in its extending class. select. That means all the methods only declared but not defined. But we can call the client side mail protocol mailto via JavaScript to prompt for an email to send.Interface: Interfaces are one type of class where all the methods are abstract. How can we send mail using JavaScript? JavaScript does not have any networking capabilities as it is designed to work on client site.* or some specific database by database. [Quick].Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract.

* any condition password is simply the password of userThe generic syntax for revoke is as following > REVOKE [rights] on [database/s] FROM [username@hostname] now rights can be as explained above a) All privileges b) combination of create. $num_rows = mysql_num_rows($result). the normal forms are progressive. How can we find the number of rows in a result set using PHP? $result = mysql_query($sql. drop. insert. I do not often use Third Normal Form. the *. your tables must already be in First Normal Form.Second Normal FormWhere the First Normal Form deals with redundancy of data across a horizontal row. CURRENT_TIME() = CURTIME() What are the advantages and disadvantages of Cascading Style Sheets? . CURRENT_DATE() = CURDATE() for time use SELECT CURTIME(). but the last two are mainly academic and will not be discussed). but dependant on another value in the table How can we find the number of rows in a table using MySQL? Use this for mysql >SELECT COUNT(*) FROM table_name. username@hotsname can be either username@localhost. and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms. echo “$num_rows rows found”. select. update and delete etc. As stated earlier. so to achieve Second Normal Form. username@hostname and username@% where hostname is any valid hostname and % represents any name. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key. $db_link). Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. How many ways we can we find the current date using MySQL? SELECT CURDATE().and username@% where hostname is any valid hostname and % represents any name. We want to ensure that there is no duplication of data in a given row. and that every column stores the least amount of information possible (making the field atomic). the *.First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data from horizontal rows.* any condition Explain Normalization concept? The normalization process involves getting our data to conform to three progressive normal forms.Third Normal Form I have a confession to make.

External Style SheetsAdvantagesCan control styles for multiple documents at once. Selector grouping methods can not be used to create complex element addressing scenarios What type of inheritance that PHP supports? In PHP an extended class is always dependent on a single base class. Can not control styles for multiple documents at once. Selector and grouping methods can be used to apply styles under complex contextsDisadvantagesAn extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitionsEmbedded Style Sheets Advantages Classes can be created for use on multiple tag types in the document. that is. Author can not create or control classes of elements to control multiple element types within the document. No additional downloads necessary to receive style information Disadvantages This method can not control styles for multiple documents at once Inline Styles Advantages Useful for small quantities of style definitions. Selector and grouping methods can be used to apply styles under complex contexts. Classes are extended using the keyword ‘extends’. Classes can be created for use on multiple HTML element types in many documents. Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods Disadvantages Does not distance style information from content (a main goal of SGML/HTML). multiple inheritance is not supported. The structure of table view buyers is as follows: Field Type Null Key Default Extra user_pri_id int(15) PRI null auto_increment userid varchar(10) YES null .

What is the difference between GROUP BY and ORDER BY in Sql? ORDER BY [col1]. Tels DBMS according to what columns it should sort the result. What is the value for this auto incremented field user_pri_id In both cases let the value for auto increment field be n then next row will have value n+1 i.</p> </body> The document tree diagram (with the <em> element to be targeted) would . rest 10 bytes will be free. The hash is a 32-character hexadecimal number.[col2]. How can we know the number of days between two given dates using PHP? $date1 = date(’Y-m-d’). SUM(col1). support cross platform. if each char takes a byte. What is descendant structure in CSS? Descendant selectors are used to select elements that are descendants of another element in the document tree. sum all values or view average What is the difference between char and varchar data types? Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m bytes Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes eg. $days = (strtotime($date1) . AVG(col1) with it. you may wish to target a specific <em> element on the page. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on. $date2 = ‘2006-08-15′. What is the functionality of md5 function in PHP? Calculate the md5 hash of a string.For example.[coln].the value of user_pri_id the last row 999 then What will happen in the following conditions? Condition1: Delete all the rows and insert another row then. name varchar(15) will just use 5 bytes if we store ‘mizan’. Tels DBMS to group results with same value of column col1. I use it to generate keys which I use to identify users etc. What is the starting value for this auto incremented field user_pri_id . name char(15) will waste 10 bytes if we store ‘mizan’. but not all <em> elements.…. 1000 What are the advantages/disadvantages of MySQL and PHP? Both of them are open source software (so free of cost). if each char takes a byte eg. Condition2: Delete the last row(having the field value 999) and insert another row then. php is faster then ASP and JSP.…. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using. You can use COUNT(col1). What is ‘float’ property in CSS? The float property sets where an image or a text will appear in another element. if you want to count all items in group.e.[col2]. A sample document could contain the following code: <body> <h1>Heading <em>here</em> </h1> <p>Lorem ipsum dolor <em>sit</em> amet.GROUP BY [col1].strtotime($date2)) / (60 * 60 * 24).[coln].

If this rule is applied. } You can also jump levels in the document tree structure to select descendants.</p> <ul> <li>item 1</li> <li>item 2</li> <li><em>item 3</em></li> </ul> </body> The document tree (with a third-level <em> element highlighted) would be: Using the following rule you can isolate any <em> element inside a <ul> element. What is Child Descendant structure in CSS? Child selectors A child selector is used to select an element that is a direct child of another element (parent).be: If you use a type selector like the example below. If this rule is applied. without having to describe the <li> element. } However. only direct children. The rule below will only select <em> elements that are descendants of <p> elements. you can refine the <em> elements that you select. However. the <em> element within the <h1> will not be colored blue. if you use a descendant selector. . For example. the <em> element within the <p> will not be colored blue: ul em {color: blue. Child selectors will not select all descendants. you will select all <em> elements on the page: em {color: blue. the following code: <body> <p>Lorem ipsum dolor <em>sit</em> amet. } Descendant selectors are well supported across standards- compliant browsers. p em {color: blue. any <em> element within a <ul> element will be colored blue.

These houses all have different characteristics. . such as sold and bought. A computer object is a representation of a real object. JavaScript doesn’t have a keyword specific to class. but are supported by most other standards-compliant browsers. and so on. and all having access to the same methods. 5.For example. all with object properties. } Child selectors are not supported by Windows Internet Explorer 5. such as number of rooms and price. including information about the number of rooms and the price. but not other <em> elements that are descendants of the <div>.A full estate agent program would be difficult to demonstrate here. but once you see the point of them.In this example. but we can introduce the use of classes.An estate agent may have a lot of houses available. so we must go back to basics and develop classes in a different way.We have already met objects. Other <em> elements that are descendants but not direct children of the <div> will not be targeted. div > em { color: blue. The house class produces house objects. For an estate agent the object may be a house. They are viewed. their use can be invaluable.5 and 6. } OR div>em { color: blue. So a class can create objects with a group of properties and methods. and as objects they all go through the same processes. This isn’t very difficult. we have the house class. surveyed and bought. How to create a class in JavaScript? Classes can seem off-putting at first. A sample document could contain the following code: <body> <h1>Heading <em>text</em></h1> <div> This is some <em>text</em> <p>This is a paragraph of <em>text</em></p> </div> </body> The document tree (highlighting the <em> that is a child of the <div&gt would be: Using the following rule you can target any <em> element that is a child of the <div>. you may wish to target an <em> that is a direct child of a <div>. .

with (house2) document. (See example) . ‘+(garage?’a':’no’)+’ garage. </SCRIPT> </HEAD> </HTML> We define a House function that takes three parameters. this. which would be very tedious and is why we use the class structure instead. price and garage. with (house1) document. I have introduced the ternary operator. (garage?’a':’no’) means if garage is true. which becomes an object. house1. Class Methods The House class we have so far defined only contains object properties.true). We would have to type this in for all houses.100000. return ‘a’ else return ‘no’.write() action we used before. When we display the details for a house. house1. Using the ternary operator removes a line of code. and costs £’+price+’<BR>’). We could add a method to replace the document. So. When we call the House function. and avoids having to create a new variable. this. and costs £’+price+’<BR>’).write(’House 2 has ‘+rooms+’ rooms. ‘?:’.price=price. <HTML> <HEAD> <TITLE>Estate Agent</TITLE> <SCRIPT> function House(rooms.garage=false. The function uses the this keyword to create an object.price. ‘+(garage?’a':’no’)+’ garage. rooms.write(’House 1 has ‘+rooms+’ rooms.garage) { this.false).rooms=4.200000. } house1=new House(4. The ternary operator is a compacted version of: if (garage) str=’a'. we assign the result to our variable.Class Properties Let us examine a very small estate agent program.garage=garage. house1. else str=’no’. house2=new House(5.rooms=rooms. identical code would be: house1=new Object().price=100000.

including C. so that we can identify the house in question.rooms. Java. preventing Cross Site Scripting (XSS) flaws 5.e. In JavaScript.2.true).garage=garage. this. this. Turning off error reporting and exposing to the site for hackers. C++.false). Never trust your user and always filter input before taking it to any operation. this. </SCRIPT> </HEAD> </HTML> Much better! Note how we must add another property. house2=new House(’Big House’. Python. Provide access control.price=price.December 1999. house2.write(name+’ has ‘+rooms+’ rooms. ‘+(garage?’a':’no’)+’ garage. JavaScript. Standard ECMA-262 3rd Edition . } function view() { with (this) document.view(). Validate Input.view=view. It is based on a subset of the JavaScript Programming Language. house1.3. C#. properties and objects. These properties make JSON an ideal data-interchange language. i. What is JSON? What are the notations used in JSON? JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write.rooms=rooms.<HTML> <HEAD> <TITLE>Estate Agent 2</TITLE> <SCRIPT> function House(name. Session ID protection4. This offers more flexibility than re-using the variable name. this. But it is not always necessary to use namespace.200000.5.garage) { this. and many others.4. SQL injection vulnerabilities.price. to get the view() function to use the string ‘house1′. it is very difficult. a namespace is really just an object that you’ve attached all further methods. if not impossible. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages. name. How you provide security for PHP application? There are many ways to accomplish the security tasks but the most common 7 ways are1.100000. and costs £’+price+’<BR>’). Instead use log file to catch exceptions . 6. Perl.name=name. } house1=new House(’House 1′. Are namespaces are there in JavaScript? A namespace is a container and allows you to bundle up all your functionality using a unique name. and the variable name is inaccessible anyway. It is easy for machines to parse and generate.view().

While this particular example might not seem so harmful. depending on the database you are using. for example). 'mypass'. ‘$reg_password’. ?> Rather than the intended action of creating a single account (good_guy) with a valid email address. '1234'. which should immediately look suspicious. ?> This query is constructed with $_POST. The registration application generates a temporary password and emails it to the user to verify the email address. but with no data filtering in place. Effective Data handling What is SQL Injection in PHP security? SQL injection attacks are extremely simple to defend against. reg_email) VALUES ('bad_guy'. ‘{$_POST['reg_email']}’)”. a user can potentially terminate the existing query with a semicolon and follow this with a query of the user’s choosing. ''). reg_password. Thus. but many applications are still vulnerable.net.net')". reg_email) VALUES ('{$_POST['reg_username']}’. it might be possible to send multiple queries to the database server in a single call. the application can’t tell. 'shiflett@php. 'mypass'. ''). Imagine that the user enters the following as a username: bad_guy'. it should be clear that worse things could happen once an attacker can make modifications to your SQL statements.7. . the SQL statement becomes the following: <?php $sql = "INSERT INTO users (reg_username. The user provides a desired username and an email address. and the user supplied every detail of the bad_guy account. ('good_guy'. and 1234 is what the application generates for the password. Consider the following SQL statement: <?php $sql = "INSERT INTO users (reg_username. For example. If a valid email address is given (shiflett@php. Assume that this query is creating a new account. the application has been tricked into creating two accounts. reg_password. ('good_guy This certainly doesn’t look like a valid username.

php?name= <script language=javascript>alert . But let’s modify the querystring by replacing our visitor’s name passed in the URL: http://www. and some are practically eliminated. because it limits what an attacker can potentially do. We’re displaying the content of the “name” variable. Protecting against SQL injection is easy: • Filter your data. most security concerns are mitigated. addslashes() is a good last resort. so this particular risk is mitigated. let’s see a usual situation. and then displaying it on our “welcomepage.If your database allows it (MySQL does). stripslashes($_GET[‘name’]). Newer versions of MySQL allow multiple queries. Everything seems to be fine. Let’s say we are taking some information passed in on a querystring (the string after the (?) character within a URL). regardless of the data type. by using the $_GET superglobal PHP array.Sometimes valid data can unintentionally interfere with the format of the SQL statement itself. Escape your data. we are passing the visitor’s name as a parameter in the URL.php?name=John As we can see in this simple querystring.yourdomain.com/welcomedir/ welcomepage. With good data filtering in place.com/welcomedir/ welcomepage. put single quotes around all values in your SQL statements.yourdomain.com/welcomedir/welcomepage.yourdomain. but the corresponding PHP extension (ext/mysqli) requires that you use a separate function if you want to send multiple queries (mysqli_multi_query() instead of mysqli_query()). What is cross site Scripting? To understand what Cross Site Scripting is. with the purpose of displaying the content of a variable. until recently.This cannot be overstressed. Only allowing a single query is safer. does not allow multiple queries. as we have done probably hundreds of times.MySQL. common to many sites. • Quote your data.php?name=John with something like this: http://www.php” page with the following PHP code: <?php echo ‘Welcome to our site ’ . If there isn’t a specific one. the visitor’s name: http://www. what’s wrong with this code? Nothing really. for example. Now. ?> The result of this snippet is shown below: Welcome to our site John This is pretty simple and straightforward. Use mysql_escape_string() or an escaping function native to your particular database.

<script language=javascript> alert(‘Hey. you are going to be hijacked!’). 94. give the case where we can use get and we can use post methods? Answer: . from an array in php) use array_search(). array_keys(). Which sorting method is lowest time consumable? HeapSort. Which sorting method is lowest memory consumable? What are the differences between GET and POST methods in form submitting. Which method do you follow to get a record from a million records? (Searching. you are going be hijacked!” after the “Welcome to our site” phrase. you are going to be hijacked!’). you’re correct.</script> ?> The output of this code is an alert JavaScript box telling you “Hey.php” page? Yes.(‘Hey. 93. array_values(). Merge sort are the lowest time consumable sorting algorithm. and in_array().</script> Do you remember the PHP code included in our “welcome. This means that any pasted JavaScript code into the URL will be executed happily with no complaints at all. the following code is executed: <?php echo ‘Welcome to our site ‘ . When we modify the querystring. not from database. right? That’s a simple example of the Cross Site Scripting vulnerability. …. array_key_exists(). Very ugly stuff.

we can call the document.e. Data submitted by the POST method will not be displayed anywhere on the browser.On the server side. i.GET method is mostly used for submitting a small amount and less sensitive data. I do not often use Third Normal Form.Marco Tabini is the founder and publisher of php|architect.On the browser side. Explain normalization concept? The normalization process involves getting our data to conform to three progressive normal forms. but the last two are mainly academic and will not be discussed). the normal forms are progressive. POST method is mostly used for submitting a large amount or sensitive data. We want to ensure that there is no duplication of data in a given row.submit() function to submit the form. but dependant on another value in the table What’s the difference between accessing a class method via -> and via ::? :: is allowed to access methods that can perform static operations. your tables must already be in First Normal Form. For example: How many ways we can retrieve the date in result set of mysql Using php? Answer: As individual objects so single record or as a set or arrays. What are the advantages and disadvantages of CASCADE STYLE SHEETS? . As stated earlier. so to achieve Second Normal Form. The $_POST array stores data submitted by the POST method. In the JavaScript code. and that every column stores the least amount of information possible (making the field atomic). Second Normal Form Where the First Normal Form deals with redundancy of data across a horizontal row. those. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key. which do not require object initialization. and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms.net/.form. Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. How can we submit from without a submit button? Answer: We can use a simple JavaScript code linked to an event trigger of any form field. First Normal Form The First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. Third Normal Form I have a confession to make. The $_GET array stores data submitted by the GET method. the main difference between GET and POST is where the submitted is stored. Who is the father of php and explain the changes in php versions? Answer: Rasmus Lerdorf for version changes go to http://php. the difference is that data submitted by the GET method will be displayed in the browser's address field.

External Style Sheets Advantages Can control styles for multiple documents at once Classes can be created for use on multiple HTML element types in many documents Selector and grouping methods can be used to apply styles under complex contexts Disadvantages An extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitions Embedded Style Sheets Advantages Classes can be created for use on multiple tag types in the document Selector and grouping methods can be used to apply styles under complex contexts No additional downloads necessary to receive style information Disadvantage This method can not control styles for multiple documents at once Inline Styles Advantages Useful for small quantities of style definitions Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods Disadvantages Does not distance style information from content (a main goal of SGML/HTML) Can not control styles for multiple documents at once Author can not create or control classes of elements to control multiple element types within the document Selector grouping methods can not be used to create complex element addressing scenarios What type of inheritance that php supports? In PHP an extended class is always dependent on a single base class. the Browser often keeps this page in its cache. that is. Classes are extended using the keyword 'extends'. Using HTML tag <span style="color: red"> When viewing an HTML page in a Browser. When you want to show some part of a text displayed on an HTML page in red font color? What different possibilities are there to do this? What are the advantages/disadvantages of these methods? There are 2 ways to show some part of a text in red: 1. How can we change the name of a column of a table? MySQL query to rename table: RENAME TABLE tbl_name TO new_tbl_name or. A page that Internet Explorer is browsing is not cached until half of the 64 KB buffer is filled. ALTER TABLE tableName CHANGE OldName newName. the Web page may still be cached in the Temporary Internet Files folder. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)? When you use the metatag in the header section at the beginning of an HTML Web page. Using HTML tag <font color="red"> 2. metatags are inserted in the header section of an HTML document. Usually. multiple inheritance is not supported. which .

Please give a regular expression (preferably Perl/PREG style). $word->Documents[1]->SaveAs("Useless test. Servlet Function Script Language output Function Different Type of embedded Package to output to a browser . which can be used to identify the URL from within a HTML link tag. //free the object $word->Release(). server_name: name of the DCOM server from which the component should be fetched. Try this: /href="([^"]*)"/i How can I use the COM components in php? The COM class provides a framework to integrate (D)COM components into your PHP scripts. it is removed. For example: What are the different ways to login to a remote server? Explain the means. //open an empty document $word->Documents->Add(). If it is there. When the HTML code is parsed. Parameters: module_name: name or class-id of the requested component. ASP. CP_UTF7 and CP_UTF8.doc"). To properly prevent the Web page from appearing in the cache. Possible values are CP_ACP. JSP.ini. //do some weird stuff $word->Selection->TypeText("This is a test…"). Internet Explorer looks for the existence of the page in cache at that exact moment. codepage . place another header section at the end of the HTML document. string server_name [.COM class constructor. $word = null. string COM::COM( string module_name [. To allow DCOM com. If NULL. localhost is assumed. int codepage]]) . CP_MACCP. When the metatag is read.specifies the codepage that is used to convert php-strings to unicode-strings and vice versa. CP_SYMBOL. Usage: $word->Visible = 1. CP_THREAD_ACP. How many ways we can give the output to a browser? HTML output PHP. it is read from top to bottom. CP_OEMCP.appears at the beginning of the document. //closing word $word->Quit(). allow_dcom has to be set to TRUE in php. 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.