1.
If you create a virtual site at port 8000, how would you refer to it in a browser?
Correct Answer
A. Http://localhost:8000
Explanation
To refer to a virtual site created at port 8000 in a browser, the correct URL would be "http://localhost:8000". The URL consists of the protocol (http), followed by the domain name (localhost), and the port number (8000) where the virtual site is hosted. This format allows the browser to establish a connection with the virtual site and display its content.
2.
In order to create a new IP address in Linux, where would you store the new configuration?
Correct Answer(s)
B. Rc.local
C. Httpd.conf
Explanation
The correct answer is rc.local, httpd.conf. In Linux, the rc.local file is commonly used to store system startup commands and scripts. By adding the necessary configuration for the new IP address in the rc.local file, it will be applied during the system startup process. On the other hand, httpd.conf is the configuration file for the Apache HTTP server, which is responsible for handling web server settings. While it may not be the most appropriate location for storing IP address configurations, it could potentially be used for specific cases involving web server IP addresses.
3.
Stored information about a previous visit to a Web Site is called _______ information.
Correct Answer
B. State information
Explanation
State information refers to the stored information about a previous visit to a website. This can include data such as user preferences, login credentials, or session details. State information allows websites to personalize the user experience and remember specific information about the user's interactions. HTTP, on the other hand, is a protocol used for communication between web servers and clients, and is not directly related to storing information about previous visits.
4.
Which of the following is not a tool for maintaining state information with pHP?
Correct Answer
C. Functions
Explanation
Functions in PHP are not specifically designed for maintaining state information. They are used to organize and reuse code, perform specific tasks, and return values. State information is typically managed using tools like hidden form fields, query strings, and cookies. Hidden form fields allow data to be passed between web pages without displaying it to the user. Query strings can store data in the URL itself. Cookies are used to store data on the user's computer.
5.
To open a connection to a MySQL database server, use ________ in pHP.
Correct Answer
C. Mysqli_connect()
Explanation
To open a connection to a MySQL database server in PHP, the correct function to use is mysqli_connect(). This function establishes a connection to a MySQL database server using the MySQL Improved Extension (mysqli). It takes parameters for the server name, username, password, and database name, and returns a connection object that can be used to interact with the database.
6.
One way to preserve information following a user's visit to a Web page is to append a _______ at the end of a URL.
Correct Answer
A. Query string
Explanation
A query string can be appended at the end of a URL to preserve information following a user's visit to a web page. It is a part of the URL that contains data in the form of key-value pairs. This data can be used to pass information to the server or to dynamically generate content on the web page. By including a query string in the URL, the information can be retained and accessed by the server or other scripts on the page.
7.
You create a cookie by passing to the setcookie() function a required _________ argument and five optional arguments in pHP.
Correct Answer
B. Name
Explanation
In PHP, when creating a cookie using the setcookie() function, the required argument is the name of the cookie. This argument specifies the name of the cookie and is necessary for creating a cookie. The function also accepts five optional arguments, including value, expires, and path, which can be used to set additional properties for the cookie. However, the name argument is mandatory and must be provided when creating a cookie.
8.
You store session state information in the $_Session __________
Correct Answer
B. Autoglobal
Explanation
The correct answer is "autoglobal" because the session state information in PHP is stored in the $_SESSION superglobal variable. This variable is automatically available in all scripts once a session is started and can be used to store and retrieve session data across multiple pages or requests.
9.
What is the correct syntax for creating a temporary cookie containing a value of "blue"?
Correct Answer
C. Setcookie("color","blue");
Explanation
The correct syntax for creating a temporary cookie containing a value of "blue" is setcookie("color","blue"). This function is used to set a cookie in PHP, and it takes two parameters: the name of the cookie and its value. In this case, the name of the cookie is "color" and the value is "blue".
10.
I am triying to reach a webserver, www.leetechnology.com. A DNS response tells me __________
Correct Answer
A. The IP address of www.leetechnology.com
Explanation
The DNS response tells the user the IP address of the website they are trying to reach, which in this case is www.leetechnology.com.