Clicking the ‘randomize’ button situated above the reference table generates a new table whereby the function descriptions, function syntaxes, and function return values are randomized. The quiz involves matching the function descriptions, function syntaxes, and function return values to the correct function name. Information relating to the randomization of table cells will be displayed for three seconds, before disappearing.
On a desktop computer, table elements are selected by left-clicking the desired table cell and holding the left click in the mouse down position for one second before releasing the left click. The text inside the table cell will turn red to indicate that the one-second mouse left-click has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second left mouse-click process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second left mouse-click process on the original table cell.
To select a table element on a touchscreen device (mobile, tablet), simply touch the desired table cell and maintain the touch for one second before removing your finger from the screen. The text inside the table cell will turn red to indicate that the one-second touch has successfully selected a table cell. To then swap the selected table cell with the target table cell, simply repeat the one-second touch process on the target cell; the table cells will swap position. To de-select a table cell, simply repeat the one-second touch process on the original table cell.
Normal touchscreen scrolling behaviour is exhibited by the cells with a light green background; cells without a light green background will not respond to normal touchscreen scrolling. The table is positioned in such a way that the user can also initiate touchscreen scrolling by swiping to the right or left of the table.
When a row consists of the correct function name, function description, function syntax, and function return value, the background colour of the row will change from ‘transparent’ to ‘khaki’; this provides visual feedback that the row is complete.
Once the entire table is complete, a paragraph of feedback will congratulate the user and provide the following information: date and time of quiz commencement; date and time of quiz completion; and the length of time it took the user to complete the quiz.
VIEWPORT OPTIONS:
An example of the layout designed for mobile phonesAn example of the layout designed for tabletsAn example of the layout designed for desktop computers
PURPOSE:
This webpage serves two purposes:
It provides a reference table for the PHP FTP functions, with information extracted and condensed from w3schools.com and php.net.
It enables users to complete a quiz related to the PHP FTP functions.
USAGE:
For each FTP function there are four table cells of information: the function name; the function description; the function syntax; and the function return value. There are three layouts available – ‘mobile‘, ‘tablet‘, and ‘desktop‘.
Click the relevant button below to display the PHP FTP functions reference table, sized appropriately for the desired viewport. A ‘RANDOMIZE‘ button appears above the reference table once the viewport is selected; clicking this button facilitates the commencement of a quiz.
Click the ‘RANDOMIZE‘ button to randomize the functional descriptions, the functional syntaxes, and the functional return information.
FUNCTION NAME
FUNCTION DESCRIPTION
FUNCTION SYNTAX
FUNCTION RETURN VALUE
ftp_fget()
[ftp_fget – Downloads a file from the FTP server and saves to an open file]
This function downloads [‘gets’] remote_file from the FTP server and writes it to the given file_pointer.
ftp_fget(ftp_stream, file_pointer, remote_file, mode[optional parameter, with a default value of FTP_IMAGE], resume_pos[optional parameter, with a default value of 0]);
[mode specifies the mode of transport – must be either FTP_ASCII or FTP_BINARY. resume_pos specifies the position in remote_file to start downloading from.]
ftp_fget(): returns TRUE on success; FALSE on failure.
ftp_fput()
[ftp_fput – Uploads from an open file to the FTP server]
This function uploads [‘puts’] the data from file_pointer to remote_file on the FTP server.
ftp_fput(ftp_stream, remote_file, file_pointer, mode[optional parameter, with a default value of FTP_IMAGE], startpos[optional parameter, with a default value of 0]);
[mode specifies the transfer mode, and must be either FTP_ASCII or FTP_BINARY. startpos specifies the position in remote_file to start uploading to.]
ftp_fput(): returns TRUE on success; FALSE on failure.
ftp_get_option()
[ftp_get_option – Retrieves various runtime behaviours of the current FTP stream]
This function returns [‘gets’] the value for the requested option from the specified FTP connection.
ftp_get_option(ftp_stream, option);
[option can be either FTP_TIMEOUT_SEC (returns the current timeout used for network-related operations) or FTP_AUTOSEEK (returns TRUE if this option is on; FALSE otherwise).]
ftp_get_option(): returns the value on success; FALSE and a warning if option is not supported.
ftp_get()
[ftp_get – Downloads a file from the FTP server]
This function retrieves [‘gets’] remote_file from the FTP server, and saves it into local_file.
ftp_get(ftp_stream, local_file, remote_file, mode[optional parameter, with a default value of FTP_BINARY], resumepos[optional parameter, with a default value of 0]);
[The file specified by local_file will be overwritten if it already exists. The transfer mode must be either FTP_ASCII or FTP_BINARY. resumepos specifies the position in remote_file to start downloading from.]
ftp_get(): returns TRUE on success; FALSE on failure.
ftp_login()
[ftp_login – Logs in to an FTP connection]
This function logs in to ftp_stream.
ftp_login(ftp_stream, username, password);
ftp_login(): returns TRUE on success; FALSE and a warning on failure.
ftp_mdtm()
[ftp_mdtm – Returns the last modified time of the given file]
This function gets the last modified time of remote_file, located on an FTP server. Not all servers support this feature, and this function does not work with directories.
ftp_mdtm(ftp_stream, remote_file);
ftp_mdtm(): returns the last modified time as a Unix timestamp on success; -1 on failure.
ftp_mkdir()
[ftp_mkdir – Creates a directory]
This function creates [‘makes’] the specified directory on the FTP server.
ftp_mkdir(ftp_stream, directory);
ftp_mkdir(): returns the newly-created directory name as a string on success; FALSE on error.
ftp_mlsd()
[ftp_mlsd – Returns a list of files in the given directory]
This function returns a manifest list of the files stored in directory on the FTP server.
ftp_mlsd(ftp_stream, directory);
ftp_mlsd(): returns an array of arrays with file information from directory on success; FALSE on error.
ftp_nb_continue()
[ftp_nb_continue – Continues retrieving/sending a file (non-blocking)]
This function facilitates the continued retrieval/sending of a file from/to an FTP server in a non-blocking fashion.
ftp_nb_continue(ftp_stream);
ftp_nb_continue(): returns one of three values – FTP_FAILED; FTP_FINISHED; or FTP_MOREDATA.
Forty-year-old father of three wonderful children [William, Seth, and Alyssa]. Works as an Assistant Technical Officer in the Sterile Services Department of Treliske Hospital, Cornwall. Enjoys jogging, web design, learning programming languages, and supporting Arsenal FC. Obtained a BA degree in English from the University of Bolton in 2008, and has continued to gain qualifications in a diverse range of subjects thereafter.
Leave a Reply