The mysql-PHP user management system deletes a user by passing an ID through GET. If someone else modifies the ID without mistake, how can this problem be prevented ??

Source: Internet
Author: User
The PHP user management system deletes a user by passing the ID through GET. in case someone else modifies the ID without mistake, how can this problem be prevented ?? Is there any other solution besides POST ?? The PHP user management system deletes a user by passing the ID through GET. in case someone else modifies the ID without mistake, how can this problem be prevented ?? Is there any other solution besides POST ??

Reply content:

The PHP user management system deletes a user by passing the ID through GET. in case someone else modifies the ID without mistake, how can this problem be prevented ?? Is there any other solution besides POST ??

I really want to modify it. You don't need to POST it. It's okay to simulate a POST operation! The key lies in permissions. verify whether the current account has the delete permission before deletion.
If you are still worried about the problem of accidental deletion, you can only add the recycle bin function to the table.trashField. DeletetrashIstrueIs not displayed on the page. The Administrator will delete the items that can be deleted from the database after review.

Before deleting a user, determine whether the Administrator has the permission to delete the user corresponding to this ID.

Make a judgment before deletion. The delete operation can also be a logical delete operation, and the logical delete operation is reversible.

Add a token for verification.

The above is true. First, check whether the deletion permission is granted before the deletion. Then the post will carry a token to prevent csrf attacks.

1. Do not delete from the database, but set a field to prevent it from being displayed.
2. Use the tokenStirng + tid + time encryption method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.