fest2 True/False True is A and False is B omit the leading dollar sign from n us
ID: 3736084 • Letter: F
Question
fest2 True/False True is A and False is B omit the leading dollar sign from n usig the variable name as an insdex for the SGLOBALS array, you name The method attribute defines how the form data is subenited to the server . The value of the method attribute will be either post or get When the form data is submitted using the get method, the form form's method attribute. 4. data is appended to the URL specified in the a form's submit button is pressed, each field on the form is sent to the Web server as a name/value pair 6. When the post method is used to submit a form, the name portion of the name/value pair becomes the value assigned to the array element. 7. When using the get method to submit form data, the form data is separated from the URL. by a colon. C) 8. PHP includes a feature called magic quotes, which automatically adds a backslash () to any single quote, double quote, or NULI character in submitted form data. 9. By default, magic quotes_gpc is the only magie quote directive enabled in the php ini configuration file. 10. The alternate method to escape strings is the stripslashes () function. 11. The round () function can be used to ensure that numbers have the appropriate number of digits after the decimal point, if any 12. A sticky form is redisplayed with the values that the user entered the last time the form was submitted. 13. In PHP, an e-mail message is sent using the email () function. 14. The subject argument of the mail function must be plain text without XHTML tags or character erExplanation / Answer
Answers with explination....
1. True : $GLOBALS is a PHP super global variable which is used to access global variables from anywhere in the PHP script (also from within functions or methods). PHP stores all global variables in an array called $GLOBALS[index]. The index holds the name of the variable.
2. True : The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute). The form-data can be sent as URL variables (with method="get") or as HTTP post transaction (with method="post").
3. True :
Notes on GET:
* Appends form-data into the URL in name/value pairs
* The length of a URL is limited (about 3000 characters)
* Never use GET to send sensitive data! (will be visible in the URL)
* Useful for form submissions where a user want to bookmark the result
* GET is better for non-secure data, like query strings in Google
Notes on POST:
* Appends form-data inside the body of the HTTP request (data is not shown is in URL)
* Has no size limitations
* Form submissions with POST cannot be bookmarked
4. True : Privious explination
5. True : The form will be submitted to the server and the browser will redirect away to the current address of the browser and append as query string parameters the values of the input fields. In terms of the HTTP protocol the following GET request HTTP request will be sent:
GET http://example.com/?namefield1=value1&namefield2=value2 HTTP/1.1
Host: example.com
If <form> is missing an action attribute, the browser will simply redirect to the current url by appending the values as query string parameters. So if this form was loaded from http://example.com/foo.php after submitting it, the browser will redirect to http://example.com/foo.php?namefield1=value1&namefield2=value2 where value1 and value2 will be the values enetered by the user in the corresponding input fields.
6. True :
$_GET is an array of variables passed to the current script via the URL parameters.
$_POST is an array of variables passed to the current script via the HTTP POST method.
7. False : Explination in Q5 shows the exapmle of GET request URL
8. True : When Magic Quotes is on, all ' (single-quote), " (double quote), (backslash) and NULL characters are escaped with a backslash automatically. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
9. True : By default magic_quotes_gpc was turned off in all 3.x.x versions of PHP. However, all PHP 4.x.x versions have this option turned on by default.
10. False : The stripslashes() function removes backslashes added by the addslashes() function.
11. True : round() method syntax
round(number,precision,mode);
precision -- Specifies the number of decimal digits to round to. Default is 0
12. True : A sticky form is simply a standard HTML form that remembers how you filled it out. This is a particularly nice feature for end users, especially if you are requiring them to resubmit a form.
13. False : The mail() not email() function allows you to send emails directly from a script.
Syntax -
mail(to,subject,message,headers,parameters);
14. True : The subject argument should be plain text even new line ' ' is not allowed. Example -
$subject = "HTML email";
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.