ExamVeda
Login
Home
51
Before you can start processing images with PHP, you must first add the ability to upload images to your administrative form on ________
Discuss
Answer & Solution
Answer: Option D
Solution:
To do this, you’ need to add a file upload input to your administrative form.
52
When you’re uploading files you need to set the enctype of the form to __________
Discuss
Answer & Solution
Answer: Option C
Solution:
Set the enctype of the form to multipart/form-data, which can accept files and standard form values.
53
To check whether a file was uploaded, you look in the _______ superglobal array.
Discuss
Answer & Solution
Answer: Option A
Solution:
Whenever a file is uploaded via an HTML form, that file is stored in temporary memory and information about the file is passed in the $_FILES superglobal.
54
To make the ImageHandler class portable you should create a separate file for it called __________
Discuss
Answer & Solution
Answer: Option B
Solution:
You save this file in the inc folder (full path: /xampp/htdocs/simple_blog/inc/images.inc.php).
55
DocBlocks are indicated by opening a comment using _________
Discuss
Answer & Solution
Answer: Option C
Solution:
This is a special comment that provides information about a class, property, or method.
56
To process the file, you need to break the array from $_FILES into individual values. You can do this using the ________ function.
Discuss
Answer & Solution
Answer: Option B
Solution:
The list() function allows you to create named variables for each array index as a comma-separated list.
57
Before you try to process the file, you need to make sure that your $err value is equivalent to _________
Discuss
Answer & Solution
Answer: Option A
Solution:
When you’re dealing with files uploaded through an HTML form, you have access to a special constant called UPLOAD_ERR_OK that tells you whether a file uploaded successfully.
58
You use the $_SERVER superglobal and your _______ property to create your path to check.
Discuss
Answer & Solution
Answer: Option D
Solution:
// Determines the path to check $path = $_SERVER[‘DOCUMENT_ROOT’] . $this->save_dir;
59
Which function do you have to use to check whether the $path you’ve stored exists?
Discuss
Answer & Solution
Answer: Option C
Solution:
If the path exists, is_dir() returns TRUE; otherwise, it returns FALSE.
60
Which one of the following is true about the following line – $obj = new ImageHandler(‘/images/’, array(400, 300));
Discuss
Answer & Solution
Answer: Option A
Solution:
If you needed to change the size of your images, you can change the dimensions using the above instantiation of ImageHandler