Suscriber with us



Receive HTML?

Syndicate

php interview questions part1 PDF Print E-mail

1.What is PHP?

executed on the server, the client cannot view the PHP code.

PHP can perform any task that any CGI program can do, but its strength lies in its compatibility with many types of databases. Also, PHP can talk across networks using IMAP, SNMP, NNTP, POP3, or HTTP.

PHP was created sometime in 1994 by Rasmus Lerdorf. During mid 1997, PHP development entered the hands of other contributors. Two of them, Zeev Suraski and Andi Gutmans, rewrote the parser from scratch to create PHP version 3 (PHP3)..

2.Wha,t can PHP do?

 Anything. PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more.

There are three main areas where PHP scripts are used.

3.Your first PHP script-"Hello World"?

 <html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
</body>
</html>

4.Installing PHPon your Computer? tec…

You can download apache2triad from
http://sourceforge.net/projects/apache2triad/

Its a single setup file for
---------------------------
Apache2 , MySQL , PostgreSQL , OpenSSL , Xmail , SlimFTPd Software developing triad of : PHP , Perl and Python + Apache2TriadCP , PHPmyadmin , PHPPgAdmin , AWStats , UebiMiau , PHPXMail , PHPSFTPd. All latest stables , all manuals

5.What is Apache?

The most widely available HTTP server on the Internet. It supports the PERL and PHP languages.

The Apache HTTP Server Project is a collaborative software development effort aimed at creating a robust, commercial-grade, featureful, and freely-available source code implementation of an HTTP (Web) server. The project is jointly managed by a group of volunteers located around the world, using the Internet and the Web to communicate, plan, and develop the server and its related documentation. This project is part of the Apache Software Foundation. In addition, hundreds of users have contributed ideas, code, and documentation to the project. This file is intended to briefly describe the history of the Apache HTTP Server and recognize the many contributors.

6.What Storage Engines do you use in MYSQL?

MySQL Engines

MyISAM

HEAP

MEMORY

MERGE

MRG_MYISAM

ISAM

MRG_ISAM

InnoDB

INNOBASE

BDB

BERKELEYDB

NDBCLUSTER

NDB

EXAMPLE

7.How can you block certain IP Address form Accessing Your site?

<?php
$banned = array("15.91. 102.120", "50.25.170.120");
if (in_array($_SERVER['T.V_ADDR'], $banned)) {
echo "You have been banned.";
exit;
}
?>

8.How to reverse a string in php with out using any built in function?

 <?php
/*
/* Reversing string with out using any built in functions
/* Author w3answers
*/

function www.phpguru.RevStr($str) {
$revStr = "";
$w=0;
while($c=$str[$w]){
$revStr = $c.$revStr;
$w=$w+1;
}
return $revStr;
}
echo w3RevStr("
www.phpguru.biz.com");
?>

Enjoy :)

9.How we can pass data form PHP to ASP,ASP.net?

 PHP to ASP

Let's first look at how you can pass data from PHP to ASP using WDDX.

You create a WDDX packet by first serializing data into a WDDX packet and then presenting it.

WDDX can convert most variable types that applications use, such as strings, integers, and arrays. After a variable has been converted to a WDDX variable type, it is ready for another application to pick up.

PHP has WDDX support built in, so you don't need to modify your PHP.ini file to start using WDDX.

10.How to conver ASP Arrays to PHP and viceversa?

ASP Arrays to PHP

WDDX also allows more-complicated data structures to be passed between applications. Here we will pass an array from an ASP WDDX script to a PHP script.

An ASP Script to Serialize an Array into a WDDX Packet
<%

'define data as ASP array
dim names
names = Array("patel", "Holli", "darshan", "mahi", "monti")

set wddxob = Server.CreateObject("WDDX.Serializer.1")

'convert ASP array to WDDX array
wddxvar = wddxob.serialize(names)

'output WDDX array
response.write wddxvar

set wddxob = nothing

%>
First, you create the array that you will convert to WDDX:

dim names
names = Array("
patel", "Holli", "darshan", "mahi", "monti")
Note that currently, the WDDX COM object accepts only this definition of an array in ASP. The other definition, shown here, won't work:

'dim names(5)
'names(1) = "patel"
Next, you load the WDDX COM object into memory:

set wddxob = Server.CreateObject("WDDX.Serializer.1")
Then you convert the ASP array into WDDX:

wddxvar = wddxob.serialize(names)
Finally, you display the WDDX and unload the WDDX COM object from memory:

response.write wddxvar
set wddxob = nothing

PHP: Hypertext Preprocessor, an open source, server-side, HTML embedded scripting language used to create dynamic Web pages.

In an HTML document, PHP script (similar syntax to that of Perl or C ) is enclosed within special PHP tags. Because PHP is embedded within tags, the author can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. And, because PHP is




Digg!Del.icio.us!Google!Live!Facebook!Slashdot!Technorati!StumbleUpon!Newsvine!Yahoo!Free social bookmarking plugins and extensions for Joomla! websites!
 
Next >

Download Utility

XAMPP
WAMP
EditPlus
Zend Studio

Polls

Which is the best Scripting language?