You are on page 1of 17

|IT6314 – WEB APPLICATION DEVELOPMENT 1 |

| ALL IN SOURCE |

- A.C.M.

PHP script tags ends with ?>; False


PHP project originally started in 1995 by RasmusLerdorf. False
(1994)
Facebook, wordpress uses php as script language. True
PHP is proprietary software. True
The default file extension for PHP files is ".php". True
PHP only runs in Apache web server. False
Working locally you an access php script by using False
http://localhosts/filename.php
Originally PHP is known as PHP: Hypertext Preprocessor False
(Personal Home Page)
Using XAMPP server you can use SQL Server database. False
Version 4 of php supports global variables $Get etc. (v4.1) False
Andi Gutmans was the inventor of PHP. False
PHP 3 was released in 1998. True
Originally PHP is known as "Personal Home Pages" False
PHP is one of the most widely used and recognizable web True
technology use on the internet.
PHP runs on various platforms operating system such as False
apache and IIS
Identify if the statement if True or False. Write True if False
statement is true otherwise False php.org is the official php
resource.
PHP in now known as "PHP: Hypertexts Preprocessor" False
Using the $_POST is allowed us to collect data from the htm True
file and display to the php script
It uses spec cols and rows attributes, or even better; through textarea
CSS' height and width properties.
Function that is used to check whether a variable is set or not. isset()
It refers to styles for your documents, including the design, CSS
layout and variations in display for different devices and
screen sizes.
represents a control that presents a menu of options. select
In PHP you can use both single quotes ( ' ' ) and double True
quotes ( " " ) for strings
Option buttons are also called Selection button False
PHP can be run on Microsoft Windows IIS(Internet Information True
Server):
A line of php code must end with a ? Semicolon ( ; )
PHP variables start with what symbol ? A $ symbol
Element represents a control that presents a menu of options. HTML select
Symbol used to combine 2 sting values to create one string. .
Is allowed us to collect data from the htm file and display to $_POST
the php script.
One of the main points of interaction between a user and a HTML forms
web site or application. They allow users to send data to the
web site.

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

Can hold an unlimited number of characters, and the text Textarea


renders in a fixed-width font.
A variable declared within a function. local
Other term use for Option buttons? Radio buttons
Area that can be specified by the cols and rows attributes, or textarea
even better; through CSS' height and width properties
Symbol use to append data or string .
A way on how to print / display text on the screen. echo
Multiple Choice. Select the best answer How do you write echo "Hello World";
"Hello World" in PHP
Multiple Choice. Select the best answer How do you start the <?php … ?>
standard form PHP scripting block?
PHP server scripts are surrounded by delimiters, which? <?php...?>
How many single line commenting types are there? 2
Which is the incorrect way to start a single line PHP /* .. */
comment?
What does PHP stand for? PHP: Hypertext Preprocessor
In PHP, the only way to output text is with echo. False
Which one of these variables has an illegal name? $my-VarV
All variables in PHP start with which symbol? $
Syntax is a set of rules that must be followed to write properly True
structured code?
What does a semicolon signify at the end of a instruction or the end of a PHP statement or
statement? instruction
All text in a multiple line comment block is ignored? True
The PHP syntax is most similar to: Perl and C
How do you start the shorthand form PHP scripting block? <? … ?>
What is the correct way to end a PHP statement? ;
When a variable is declared, it can only be used 1 time in your False
PHP source file?
PHP variables need to be declared before adding a value to False
it?
If a source file contains PHP code, what extension should be php
used?
When using the POST method, variables are displayed in the False
URL:
Whitespace is not ignored in PHP? False
Which is the correct way to write a multiple line PHP /* .. *
comment?
Which of the following is the incorrect way to declare a PHP $a_Number = 9
variable?
For maximum compatibility, you should use the shorthand False
form to create PHP scripts?
PHP can be run on Microsoft Windows IIS(Internet Information True
Server):
Look at the following code and determine what will be Hello World 1
displayed in the browser:

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

<?php
echo "Hello World 1";
// echo "Hello World 2";
?>
What data type will PHP automatically convert the following integer (a number variable)
variable to:? $aVariable = 99;
Which of the following is the incorrect way to declare a PHP $a Variable;
variable?
All variables in PHP start with a $(dollar) sign? True
What data type will PHP automatically convert the following string (a text variable)
variable to: $aVariable = "Robert";
All text to the right of a single line comment is not ignored? False
The following comparison condition would return TRUE or True
FALSE:(3 <> 6)
The following example $x -= $y; is the same as? $x = $x – $y;
The logical operator || stands for? OR
The following condition will return TRUE or FALSE: !(3 >= 3 || False
8 < 1)
The following condition will return TRUE or FALSE ( (2 >= 2 True
&& 8 < 1) || (11 == 33 || 5 > 3) )
The following condition will return TRUE or FALSE:(7 >= 7 && False
9 < 2)
The logical operator && stands for? AND
The logical operator ! stands for? NOT
If the variable $x = 11; , what will $x equal if it is incremented, 12
that is, if I write $x++; what value will $x contain after it has
been incremented?
The following condition will return TRUE or FALSE: (7 >= 7 False
&& 9 < 2)
True or False - The operator AND, when used to link two True
concept terms (e.g. children and violence) will retrieve only
those records that contain both concept terms
The concatenation operator in PHP? .
Tag is used to group block-elements to format them with CSS. div
Identification. Write your answer on the space provided. +, -, *, arithmetic operators
/, %, are all examples of what category of operators
True or False - The following search statement will exclude False
any records that contain the term "poodle." (dogs OR canines)
NOT cats.
If I wanted to concatenate a word to a string variable I would .
use which symbol?
True or False - Using the operator AND to combine concept False
terms is a good way to increase the number of records
retrieved in a search.
Symbol use as identical ===
True or False - The operator OR, when used to link two or False
concept terms will retrieve fewer records because both terms
need not be present in each article.

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

Which operator will check if two variables are the same? ==

abcd

No output

Error

Error

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

error

######### [ 9 hash]

Infinite loop

error

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

error

No output

The number is: 0


The number is: 1
What will be the output of the following PHP code ? The number is: 2
<?php The number is: 3
for($x=0;$x<=10;$x++) The number is: 4
{ The number is: 5
echo"The number is: $x<br>"; The number is: 6
} The number is: 7
?> The number is: 8
The number is: 9
The number is: 10
What will be the output of the following PHP code ? In for loopAfter for loop
<?php
for($i++;$i==1;$i=2)
print"In for loop ";
print"After loop\n";
?>
<?php 123456789101112
for($x=0;$x<=10;++$x)
{
print++$x;
}
?>
What will be the output of the following PHP code ? infinite loop
<?php
for($x=-1;$x<10;--$x)

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

{
print$x;
}
?>
What will be the output of the following PHP code ? red
<?php green
$colors=array("red","green","blue","yellow"); blue
foreach($colors as $value) yellow
{
echo "$value<br>";
}
What will be the output of the following PHP code ? After for loop
<?php
for(1;$i==1;$i=2)
print"In for loop ";
print"After loop\n";
?>
What will be the output of the following PHP code ? no output
<?php
$x;
for($x=-3;$x<-5;++$x)
{
print++$x;
}
?>
What will be the output of the following PHP code ? *********
<?php
for($x=1;$x<10;++$x)
{
print"*\t";
}
?>
What will be the output of the following PHP code ? error
< ?php
$i = 0;
for ($i)
{
print$i;
}
?>
What will be the output of the following PHP code ? In for loop In for loop In for
<?php loop In for loop......infinitely
for($i==2;++$i==$i;++$i)
print"In for loop ";
print"After loop\n";
?>

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

Chr(65)

error

What will happen in this function call? Call by value

Array ([3] => blue [4] => blue


[5] => blue [6] => blue)
Array ([0] => red )

I like Volvo, BMW and Toyota

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

Cos(0)

Array ([0] => red [1] => green


[2] => blue [3] => yellow )

Chr(49)

AMA University

Which one of the following is the right way of defining a functionfumctionName(parame


function in PHP? ters) { function body }
PHP's numerically indexed array begin with position __. 0
What is the output of the following? Ef, ef, de, , cde
echo substr("abcdef", -2), ', '; echo substr("abcdef", 4), ', ';
echo substr("abcdef", -3, -1), ', '; echo substr("abcdef", 4, -2), ',
'; echo substr("abcdef", 2, -1)
Numeric array, Associative
There are three different kind of arrays:
array, Multidimensional array
Assume you would like to sort an array in ascending order by asort()

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

value while preserving key associations. Which of the


following PHP sorting functions would you use?
To make the string's first
What is the function of the ucfirst and lcfirst functions? character uppercase or
lowercase, respectively
What will the following script output? 78
Array values are keyed by ______ values (called indexed Integer, String
arrays) or using ______ values (called associative arrays). Of
course, these key methods can be combined as well.
What functions count elements in an array? count
What is the output of the following? echo strcmp('first', -1, 1, -1, 1
'second'), ", "; echo strcmp('44', '054'), ", "; echo strcmp('0x80',
'a'), ", "; echo strcmp('a', 'A');
What is the output of the following code snippet? Qwerghzi on off on
$str = 'asdfghyo off on off'; $replace_pairs = array('a' => 'q', 's'
=> 'w', 'd' => 'e', 'f' => 'r', 'y' => 'z', 'o' => 'i', 'off' => 'on', 'on' =>
'off'); echo strtr($str, $replace_pairs);
Which statement will evaluate and include a file into the include statement
location where it is called.
6

The following condition will return TRUE or FALSE: (4 >= 4 False


&& 8 < 1)
The following condition will return TRUE or FALSE:!(4 >= 4 || False
8 < 1)
Welcome to the USA

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

1: 2, 2: 20, 3: 16

Hello World

infinitive

The PHP If Else Statement can execute the code within the if False
and else segments at the same time?
If the variable $x = 10; , what will $x equal if it is incremented, 11
that is, if I write $x++; what value will $x contain after it has
been incremented?
The logical operator && stands for? AND
Syntax Error

In which positions PHP's indexed array begin? 0

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

The PHP If Statement will only execute the code within it's False
curly braces if the if condition is FALSE?
The logical operator || stands for? OR
The logical operator ! stands for? NOT
What is the output of the following code? 4
$a=1;
++$a;
$a*=$a;
echo $a- -;
Hello world

Nothing will be displayed

The following condition will return TRUE or FALSE:(4 >= 4 || 8 True


< 1)
The following condition will return TRUE or FALSE ( (4 >= 4 True
&& 8 < 1) || (44 == 33 || 5 > 3) )
Which is identified as a special variable, which can store Array
multiple values in one single variable?
The following are examples of =, +=, *=, /=, .= _______ Assignment
Operators
The following comparison condition would return TRUE or True
FALSE:(4 <> 7)

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

Hello YouTube

The following are examples of >, <=, >=, ==________ Comparison


Operators
The following example $a -= $b; is the same as? $a = $a – $b;
Hello World

The following are examples of =, !=, === ______ Operators Equality


The ________ clause is used to list the attributes desired in Select
the result of a query.
The ______ clause allows us to select only those rows in the Where, from
result relation of the ____ clause that satisfy a specified
predicate.
Select * from employee where salary>10000 and All the field of employee
dept_id=101; Which of the following fields are displayed as relation
output?
The query given below will not give an error. Which one of the WHERE
following has to be replaced to get the desired output? Select
ID, name, dept name, sal * 1.1 where instructor;
Select name, course_id from instructor, teaches where Select name, course_id from
instructor_ID= teaches_ID; This Query can be replaced by instructor natural join teaches;
which one of the following ?
Which of the following employee_id will be displayed? 1018
Insert into employee _____ (1002,Jeiven,2000); In the given Values
query which of the keyword has to be inserted ?
Select empid where empid =
Which of the following statements contains an error? 1009 and lastname =
‘JOHANN;
Which of the following displays the unique values of the Distinct
column. Select ________ dept_name from instructor;
Unix, Linux, Windows and
MySQL runs on which operating systems?
others
Which of the following can add a row to a table? Insert
Which function used to get the current time in mysql? NOW()
A Relational Database
MySQL is
Management System

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

Some sort of client program to


To use MySQL on your computer, you'll need?
access the databases
To remove duplicate rows from the result set of a SELECT DISTINCT
use the following keyword:
A NULL value is treated as a blank or 0. False
In a LIKE clause, you can could ask for any value ending in LIKE %qpt
"qpt" by writing
Which SQL statement is used to insert a new data in a INSERT INTO
database?
The result of a SELECT statement can contain duplicate rows. True
The "I" in MySQLi stands for improved
Function that select database. mysql_select_db();
This function allows you to close the current connection. close();
Which one of the following databases has PHP supported MYSQL
almost since the beginning?
this function allows you to connect to mysql database mysql_connect(),
Which one of the following statements should be used to include 'filename';
include a file?
This command sends active query to the database mysql_query()
Which one of the following methods is responsible for sending query()
the query to the database?
Which one of the following method is used to retrieve the affected_rows()
number of rows affected by an INSERT, UPDATE, or DELETE
query
Which one of the following statements is used to create a CREATE TABLE table_name
table? (column_namecolumn_type);
Assuming the table and fields below exists, what is wrong with There are more fields than
the following mysql query example: mysql_query("INSERT values
INTO contacts (firstName, lastName, phoneNumber) VALUES
('Robert', 'Smith')");
If a PHP script opens a MySQL connection, the script will True
automatically close the connection after the script has finished
executing?
Assuming the table and fields below exists, what is wrong with There are more values than
the following mysql query example: mysql_query("INSERT fields
INTO contacts (firstName, lastName) VALUES ('Robert',
'Smith', '123-983-2929')");
The "mysql_close()" function allows you to close a MySQL True
connection?
The INSERT INTO statement is not used to add new records False
to a database table?
Assuming the table and fields below exists, what is wrong with Nothing, everything is fine
the following mysql query example: mysql_query("INSERT
INTO contacts (firstName, lastName, phoneNumber) VALUES
('Robert', 'Smith', '123-983-2929')");
The "mysql_connect()" function opens a MySQL connection? True
The "or die()" part of a MySQL command will execute if the True
connection fails?

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

The "mysql_error()" function returns the error description for a True


MYSQL operation?
returns the numbers of rows in a columns. count()
Function is used to convert a human readable string to a Unix strtotime()
time.
Joining values together (by appending them to each other) to concatenate
form a single long value.
Converts text to uppercase Upper()
Function trims all spaces from the right of a value RTRIM()
Today is April 16, 2017

30

Which one of the following function is useful for producing a mktime()


timestamp based on a given date and time.
The date() function returns ___ representation of the current String
date and/or time.
Returns the highest value MAX()
It's a function returns the Unix timestamp for a date. mktime()
It's a time manipulation function that returns the current date. CurDate()
It's a text function that returns convert string to lowercase Lower()
It's a function that returns the lowest value in a column. Min()
Is the SQL statement correct or not. SELECT vend_name, No
prod_name, prod_price, vendors.vend_id, products.vend_id
FROM vendors INNER JOINS products ON vendors.vend_id
= products.vend_id;
One of the parameters to represent the day of the month d
This are functions that operate on a set of rows to calculate Aggregate functions
and return a single value.
limits the row data are
The SQL WHERE clause:
returned.
An exact match is not possible
The wildcard in a WHERE clause is useful when?
in a SELECT statement.
What does SQL stand for? Structured Query Language
Which one of the following sorts rows in SQL? ORDER BY
With SQL, how do you select all the records from a table SELECT * FROM Persons
named "Persons" where the value of the column "FirstName" WHERE FirstName = 'Peter'
is "Peter"?
MySQL was invented in the year of 1994
The SQL keyword(s) ________ is used with wildcards. LIKE only
You can add a row using SQL in a database with which of the INSERT

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

following?
In an SQL SELECT statement querying a single table, the all columns of the table are to
asterisk (*) means that: be returned.
The SQL keyword BETWEEN is used: for ranges.
Which of the following is the correct order of keywords for SELECT, FROM, WHERE
SQL SELECT statements?
Which of the following statement is not true about MySQL it can be used to delete only
DROP command? data but not structure of a table
Acts like a WHERE clause but
The HAVING clause does which of the following? is used for groups rather than
rows.
Which of the following are the five built-in functions provided COUNT, SUM, AVG, MAX,
by SQL? MIN
When three or more AND and OR conditions are combined, it Both IN and NOT IN.
is easier to use the SQL keyword(s):
Which SQL statement is used to insert new data in a INSERT INTO
database?
SELECT NAME FROM
Find the SQL statement below that is equal to the following:
CUSTOMER WHERE STATE
SELECT NAME FROM CUSTOMER WHERE STATE = 'VA';
IN ('VA');
DELETE FROM CUSTOMER
The command to remove rows from a table 'CUSTOMER' is:
WHERE ...
To remove duplicate rows from the results of an SQL SELECT DISTINCT
statement, the ________ qualifier specified must be included
With SQL, how do you select a column named "FirstName" SELECT FirstName FROM
from a table named "Persons"? Persons
Which of the following is the original purpose of SQL? All of the above.
Return those rows from the
What does the following MySQL command do? table author in which the name
SELECT * FROM author WHERE auth_name LIKE 'W%'; of the author starts with the
character 'W
Which SQL statement is used to delete data from a database? DELETE
The SQL statement that queries or reads data from a table is SELECT
________ .
SELECT checks which
Which one of the following denotes the difference between
database is currently selected,
SELECT and USE command?
USE selects a database
has a distinct form that cannot
A subquery in an SQL SELECT statement
be duplicated by a join.
All of the above can be done
MYSQL can be used to:
by MYSQL.
Which one of the following denotes the default mysql date YYYY-MM-DD
format?
a count of number of non-
MySQL COUNT() function returns NULL values of a given
expression
To sort the results of a query use: ORDER BY.
Consider the following snippet code var string1 = "123"; var 123123

VISIT: finditsource for more !


|IT6314 – WEB APPLICATION DEVELOPMENT 1 |
| ALL IN SOURCE |

- A.C.M.

intvalue = 123; alert( string1 + intvalue );


XMLHttpRequest object function that cancel request. Abort()
JavaScript Code can be called by using Function/Method
Consider the following code snippet : var 105 as an integer value
grand_Total=eval("10*10+5");
It refers to a client-side script
that communicates to and from
AJAX is a programming language a server/database without the
need for a postback or a
complete page refresh
Ajax Status 200 means
Object is used to exchange data with a server behind the XMLHttpRequest
scenes.
Server command that calls itself $_SERVER['PHP_SELF']
Security is not an issue with JavaScript False
Original developer of JavaScript? Brendan Eich
Its a client-side script that communicates to and from a AJAX
server/database without the need for a postback or a
complete page refresh
An object-oriented computer programming language JavaScript
commonly used to create interactive effects within web
browsers
True or False. JavaScript can be inserted into any web page True
regardless of the file extension.
The keystone of AJAX XMLHttpRequest
Original Name of JavaScript LiveScript
Returns the status-number of a request if "OK" 200
Returns header information getAllResponseHeaders()
Asynchronous JavaScript And
Ajax Stands for
XML.
10

VISIT: finditsource for more !

You might also like