PHP Test paper Summary (with reference answer) _php tutorial

Source: Internet
Author: User
Tags echo b php operator script tag
The predecessor of the 1 JavaScript scripting language is b

A.basic

B.live Script

C.oak

D.vbscript

2 use CSS to decorate text, shut up text flicker, text-decoration value is D

A.none B.underline C.overline D.blink

3 XML based on the standard is C

a.html b.mime C.SGML d.cgi

4 marker title is the B between what is placed in the marker

A.html and HTML

B.head and head

C.body and Body

D.head and Body

5 The parameters of the connection picture in the tag are: B

A. href b. src C. Type D. align

6 cascading style sheet files have the following extension: B

A HTML Bcss C XML D DIB

7 in comparison with previous versions, HTML4.0:C

A added JavaScript support

B Added Flash technology

C enhanced the dynamic nature of Web pages

D Added ActiveX technology

8 in HTML, tag

The role is B

A. Title Mark B. Pre-layout mark C. Change of career mark D. Text effect marker

9 The change mark in the HTML language is b

a.html B. BR c.title D. P

10 in HTML, the maximum value of x in the caption font tag is C

A.4 b.5 C.6 D.1

11 Which of the following does not belong to the data definition language: A

A. Select

B. Create

C. Drop

D. Alter

13 about mysql_select_db The return value is correct: C

A. Successfully turned on return 1, failed to return 0

B. Successful turn on Returns a connection ID, failure returns false

C. Successful turn on Returns true, failure returns false

D. Cheng turns on returns true, Failure returns an error number

14 See the code, which connection ID will be closed by the database shutdown instruction? B

$link 1 =mysql_connect ("localhost", "root", "");

$link 2 =mysql_connect ("localhost", "root", "");

Mysql_close ();

?>

A. $link 1

B. $link 2

C. Close all

D. Error

What operation does the Mysql_affected_rows () have no effect on? A

A. Select

B. Delete

C. Update

D. Insert

Mysql_data_seek (query result pointer, record location) function, how much is the value of the data record position starting from? D

A. 1

B. 2

C. 3

D. 0

17 The function that gets the total number of records in the result set of the search statement is: C

A. Mysql_fetch_row

B. Mysql_rowid

C. mysql_num_rows

D. Mysql_fetch_array

18 about Mysql_pconnect The right thing to say is: D

A. Multiple connections to the database

B. Same function as Mysql_connect

C. Same function as @mysql_connect

D. Establishing a persistent connection to a database

19 what function should I use if I want to get the running state of MySQL database system? C

A. mysql_ping

B. Mysql_status

C. Mysql_stat

D. Mysql_info

The effect of the mysql_insert_id () function is: B

A. Viewing the ID number of the next time the record is inserted

B. View the auto-Grow ID value that you just inserted

c. See how many insert operations have been done

D. See how many records there are

The function of the mysql_ping () function and the type of the return value are correct: D

A. Check the status of the database system and return the integer value

B. Check the status of the database system, the return value is Boolean type

C. Check if the connection to the server is normal, return the integer value

D. Check if the connection to the server is normal and the return value is Boolean

22 Existing Trolley Class program (CART.INC) which contains a method for adding items (Add_item),

The following option is the correct way to use Add_item A

Classcart {

Var$items;

Functionadd_item ($artnr, $num) {

$this-items[$artnr] + = $num;

}

}

?>

A.

Require ("Cart.inc");

$cart = new Cart;

$cart-Add_item ("10", 1);

?>

B.

Require (CART.INC);

$cart = new Cart

Add_item, $cart ("10", 1)

?>

C.

Require ("Cart.inc");

$cart = new cart ();

$cart-Add_item ("10", 1);

?>

D.

Include ("Cart.inc");

$cart = new cart ();

$cart-Add_item ("10", 1);

?>

23 about Mysql_db_query and mysql_query the right thing to say is: C

A. The return value of Mysql_db_query and mysql_query after executing the SQL statement is the same, the resource number is returned successfully, and the failure returns false

B. You cannot use the Mysql_query function to temporarily execute SQL statements on another database, and Mysql_db_query can

C. Mysql_db_query does not switch back to the previously connected database

D.mysql_query is functionally equal to mysql_select_db () +mysql_db_query ()

24 The following code executes the result a

mysql_connect ("localhost", "root", "" ")

$result = mysql_query ("Select Id,name from tb1");

while ($row =mysql_fetch_array ($result, MYSQL_ASSOC))

{echo "ID:".) $row [0]. " Name: ". $row [];}

?>

A. Error

B. Print only the first record

C. Loop wrap Print all records

D. No results

25. The difference between mysql_connect () and @mysql_connect () is () B

A @mysql_connect () does not ignore the error and displays the error to the client

B mysql_connect () does not ignore the error and displays the error to the client

C No difference

Two functions with a different D function

26. Statement for ($k =0; $k =1; $k + +), and statement for ($k =0; $k ==1; $k + +); The number of executions is: A

A Infinity and 0

B 0 and Infinity

C is infinite

D's all 0.

27. The method of reading the value of the form element passed by the Post method is: B

A $_post["Name"]

B $_post["Name"]

C $post ["Name"]

D $POST ["Name"]

28. In the PHP operator, the priority from high to Low is () D

A relational operator, logical operator, arithmetic operator

B arithmetic operators, relational operators, logical operators

C logical operators, arithmetic operators, relational operators

D relational operators, arithmetic operators, logical operators

29. The value of the cookie is stored in () C

A in A hard drive

In program B

C Client

D Server-side

30. To view the data type of a variable, you can use the function () B

A type ()

B GetType ()

C GetType ()

D Type ()

31. The comparison of strings is done by (). B

A Phonetic sequence

B ASCII code value

C Random

D sequencing

32. The value of the check box's Type property is () a

A checkbox

B Radio

C Select

D Check

33. The values of session sessions are stored in () D

A on the hard drive

B in the Web page

C Client

D Server-side

34. If you want to get information about a recent query, which function should be used () a

A Mysql_info

B Mysql_stat

C mysql_insert_id ()

D Mysql_free_result

35. To view the values of a struct type variable, you can use the function () B

A Print ()

B print ()

C Print_r ()

D Print_r ()

36. Which array of variables in PHP always contains all the cookies sent by the total client () B

A $_cookie

B $_cookies

C $_getcookie

D $_getcookies

37. Which of the following statements is wrong () B

A GetType () is a view of the data type

B the variable that has no value assigned is 0

C unset () is considered null

D Double Quote string The most important point is that the variable name is substituted by the value of the variable

38. The function of the Strtolower () function is () a

A converts the given string to all lowercase letters

B convert the given string all to uppercase

C converts the given string first letter to a lowercase letter

D convert the given string first letter to uppercase

39. In HTML, the "value" of the table cell is stored in the () label B

A⟨body>

B⟨td>

C⟨tr>

D⟨table>

40. The function that converts a value or variable to a character type is () B

A Intval ()

B Strval ()

C Str

D Valint ()

41. The connection operator for strings in PHP is () D

A

B +

C &

D.

42. Functions not supported by PHP functions are: C

A variable number of parameters

B passing parameters by reference

C passing parameters through pointers

D Implementing Recursive functions

43. The file box's Type property value is () a

A text

B Hidden

C textarea

D checkbox

44. The function of the operator "^" is () C

A is not valid

B-exponentiation

C-bit non-

D-bit XOR or

45. In the custom function, the keyword that returns the value of the function is () C

A returns

B Close

C return

D back

46. To check whether a constant is defined, you can use the function () C

A defined ()

B Isdefin ()

C isdefined ()

D None

47. About the function of the mysql_select_db description right is () D

A Connecting the database

B Connect and select the database

C Connect and open the database

D Select a database

48. In HTML, where the title tag is placed B

A body tag.

B head tag.

C script tag.

D table tag.

49. Use the () function to calculate the size of the array a

A count ()

B Conut ()

C $_count["Name"]

D $_conut["Name"]

50. You can use the () function to delete data from the queue number team header. A

A Array_push ()

B Array_pop ()

C Array_shift ()

D Array_unshift ()

51. Embed JavaScript in HTML, the tag you should use is () a

A⟨script language= "JavaScript" >

B⟨head>⟨/head>

C⟨body>⟨/body>

D⟨!--....//. >

52. The following code runs the result () D

$A =array ("Monday", "Tuesday",3=> "Wednesday");

Echo $A [2];

A Monday

B Tuesday

C Wednesday

D not shown

53. The function of creating a new array is () a

A Array

B Next

C Count

D Reset

54. The following incorrect variable name is () B

A $_test

B $2ABC

C $Var

D $printr

55. The method of reading the value of a FORM element passed by the Get method is: a

A $_get["Name"]

B $get ["Name"]

C $GEG ["Name"]

D $_get["Name"]

56. The meaning of function vat_dump is () C

A definition Array

B traversing an array

Information about the C output variable

D Recursive array

57. The function of the Strtoupper () function is: a

A converts the given string all to uppercase.

B converts all given strings to lowercase letters.

C converts the first letter of the given string to uppercase.

D converts the first letter of the given string to lowercase letters.

58. The following code runs the result () B

if ($i = "")

{echo "a";}

Else

{echo "B";

}

?>

A output a

b Output B

C Insufficient condition to determine

D Error Running

59. In the Str_replace (All-in-one) function 1 2 3 is represented by the name () B

A "substituted string", "substituted string", "source string"

B "substituted string", "replace string", "source string"

C "source string", "replace string", "substituted string"

D "source string", "superseded string", "replace string"

60. What part of HTML do you see when you browse a Web page? C

A Title

B table

C body

D Head

61. The effect of the operator "%" is () C

A is not valid

B rounding

C to take the remainder

D except

62. The data type returned by the file () function is () B

A Array

B string

C Integral type

D according to the document to decide

63, assuming $a=5, there is $a+=2, then $ A value of C

A. 5 B. 6 C. 7 D. 8

64, the following about the MySQL narrative, the error is D

A. MySQL is a truly multi-threaded, single-user database system

B. MySQL is a true support for multi-platform

C. mysql fully supports ODBC

D. MySQL can mix tables from different databases in one operation

65. In PHP, the comparison operator is B

A. = B.! C. = = D. &

66, PHP defines the activity variable is the method of B

A. VAR B. $ C. $$ d.&

67, PHP expression $foo=1+ "bob3", then the value of $foo is a

A. 1 B. 1bob3 C. 1b d.92

68. The bitwise operator of PHP does not include D

a.& B. | C. ~ D.!

69, about the PHP variable is said to be correct is D

A. php is a strongly-typed language

B. The PHP variable declaration needs to specify the type of its variable

C. The character used in front of the variable name when the PHP variable is declared is "&"

D. When a PHP variable is used, the context automatically determines the type of its variable

70, in PHP embedded HTML document using the bounding symbol is D

A. " " end

B. End With " "

C. Start with "<%--" and End with "-%>"

D. End with " "

71, PHP syntax, assume that the known $a= "Hello", $b = "China", you want to get "Hello China" string, how to operate C

A. $a + $b B. $a-$b c. $a. $b D. $a + = $b

72, to configure the PHP environment, only need to modify a

A PHP.ini B. http.conf c. php.sys D. Php.exe

73, the following command is not the output of the PHP command is D

A. Echo B. printf () c. Print D. Write

74, the method of defining constants in PHP is C

A. VAR B. Dim C. Define () D. undefined ()

75. There are the following PHP statement segments

if ($a)

Print "true";

Else

Print "false";

?>

To output "false", $a should be D

A. B.–3 C. "True" D. "0"

76, known $g=14, the PHP expression $h= $g +=10, the result of the operation is a

A. $h = $g =24 B. $h =10, $g =24 c. $h =10 $g =14, $h =24, $g =10

77. A method or property in PHP that invokes an object uses the operator B

A.-B. C. D. ~

78, assuming $a=5, there is $b= ($a-), then $b is b

A. 4 B. 5 C, 6 D. 0

79. Marking
is used for b

A. Staging commands B. Wrap command c. end command D. Print command

80. The function in PHP to delete the current directory is: D

A ChDir B. CD c. opendir D. rmdir

The second chunk, the programming question (10 points per topic total 20 points)

1, with PHP to implement a user login program. The user table structure in database test is as follows:

User (UserID char (8), password char (6))

The pseudo code is as follows

$link =mysql_connect ("$dbhost", "$dbusername", "$dbpassword");//Connect to Database

mysql_select_db ("$dbname");

Write SQL statements

$sql = "Select ...";

$resource =mysql_query ($sql, $link);

if (Mysql_fetch_row ($resource)) {

echo "Congratulations on your landing success";

}else{

echo "The user does not exist";

}

2, in MySQL, the database "study" in the Student table content is as follows:

ID Name Sex

9701 Wang Male

9702 Zhang Male

9703 Li Female

The connection database server parameters are: ("localhost", "root", "1234")

Please use the PHP language to write a program that deletes a data record with ID 9701

$link =mysql_connect ("localhost", "root", "1234");//Connect to Database

mysql_select_db ("study");

Write SQL statements

$sql = "Delete from student where id=9701";

$boolean =mysql_query ($sql, $link);

if ($boolean) {

echo "Delete succeeded";

}else{

echo "Delete Failed";

}

?>

Iv. write down the results of the following programs and write out the general flow of the operation (10 points)

Class test{

var $a, $b;

function test ($a, $b) {

$this->a= $a;

$this->b= $b;

}

function Geta () {

return $this->a;

}

function Getb () {

return $this->b;

}

function XPrint () {

echo "A=". $this->a. "b=". $this->b;

}

};

Class Test1 extends test{

var $c, $d;

function test1 ($a, $b, $c, $d) {

$this->a= $a;

$this->b= $b;

$this->c= $c;

$this->d= $d;

}

function GetC () {

return $this->c;

}

function getd () {

return $this->d;

}

function XPrint () {

echo "A=". $this->a. "b=". $this->b. "c=". $this->c. "d=". $this->d;

}

};

$x =new Test (0,0);

$x->xprint ();

echo "
\ n ";

$y =new test1 (1,2,3,4);

$y->xprint ();

?>

A=0 b=0

A=1 b=2 c=3 d=4

http://www.bkjia.com/PHPjc/478537.html www.bkjia.com true http://www.bkjia.com/PHPjc/478537.html techarticle 1 JavaScript scripting language predecessor is B a.basic b.live script C.oak d.vbscript 2 use CSS to decorate the text, shut up text flicker, text-decoration value is D a.none B.underline ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.