Operational Qualification, prompt of page skipping and deletion verification
How to prevent the misoperation that user delete module mistakenly and
increase the quality of user experience in deletion operation?
In fact, each function of operation need to be realized by a php file.
So the function of confirm a operation also need a php file to realize it.
We can use “?url={$url}” to transmit deletion file url to confirm file page.
In the confirm file, user can chose delete or cancel. The delete button linked with the deletion url,
and the current page should go back to previous page. There is a special variable $_SEVER
which stored the information of current page. We can use $SEVER[‘REQUEST_URL’] to represent
current page url and transmit it to the confirm page. In order to make user ensure what they are deleting,
the prompt message and concrete module name can be transmitted to the confirm page.
It will appear errors if $_GET could not receive the data which transmitted from other pages.
How to solve this problem?
We need to verify whether the variables exist or not. Verify all the elements of $_GET transmitted from other page.
It will stop the next execution if there not exist the data.
How to skip to a prompt page which has good user UI interface rather than the rough prompt on the current page?
And how to realize the function of skip to current page automatically or manually?
About the process of deleting a module, there are three steps need to do.
- Enter the confirm page which need to chose yes or cancel
- Skip to the page which prompt “delete successfully” after click the delete button
- In the page which prompt you did successfully, There is a function of skipping to the current page after 3 seconds or skip right away.
In the step 2, We put the html code in skip() function,so the realization of skipping to the prompt page
just need to call the skip() function in deletion file.
In the step 3, the page can skip to the current page by “<meta http-equiv="refresh" content="3;URL={$url}" />” in the html code.
The number 3 is to control the skipping time. Otherwise, some users want to skip to the current page right away.
We can transmit a url to the prompt, and users can skip the page through clicking the link.
Sometimes users may delete all the data from database mistakenly by the method of $_GET,
how to prevent the serious problem?
if(!isset($_GET['id']) || !is_numeric($_GET['id'])){
skip('father_module.php','error','The id parameter does not exist!');
}