In: Computer Science
1. When is it preferable to use the “post” method and when is it preferable to use the “get” method?
2. What is an “all-in-one” form and when should it be used?
3. When would you use the $_SERVER['SCRIPT_NAME'] autoglobal?
4. What are several functions that are useful in validating form data?
1)POST carries request parameter in the message body which makes it more secure way of transferring data from client to server in http protocol,when you want to make a request to server with some parameter from client has to be passed to server POST is used where as GET carries request parameter appended in URL string , GET is basically used to fetch data from server i.e client request for some data and server response back with some data
2)"all-in-one" form is used when their are multiple user to do registration in a form and for all that the single user details are saved in one form , it is usefull when their are multiple user registration record has to saved.
3)$_SERVER['SCRIPT_NAME'] basically returns the path of the current script . It is declare global so it can be accessed regardless of the scope and you can access from any class function or file .
4)Function that are useful in validating form data -
checkdate() - it is used to check date is valid or not
ctype_alnum() - check if value contains numbers and letter
ctype_alpha() - check for value contains Letters only
ctype_digit() - check for value contains number