Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8109751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:31:11+00:00 2026-06-06T01:31:11+00:00

While working with Database records ,displaying them on HTML and storing their ID into

  • 0

While working with Database records ,displaying them on HTML and storing their ID into a Hidden Field ,to get which one to update is not secure ,i tried something else but im not sure if that is enough Secure .

Currently im storing the ID and the md5 checksum of ID + Somekey within another Hidden field.

<input type="hidden" name="ID" value="1"/>
<input type="hidden" name="Hash" value="<?php echo md5($ID."MYKEY"); ?>"/>

And on back-end at PHP im doing the same thing and testing if their Equals.

<?php
  $ID = $_GET['ID'];
  $Checksum = $_GET['Hash'];

  if(md5($ID."MYKEY") == $Checksum)
  //Proceed Delete or update
?> 

Im doing that because some one could just change the ID of a record and interact with someone else record.

The second solution was to check if that record was related to user by selecting it from Database and testing if that Exist’s to that specific user ,but using the Checksum i thought it could be an Optimization !

So is it enough secure to use that way ,using Checksums and generating Dynamic Key’s for each new Session.

Bests

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T01:31:13+00:00Added an answer on June 6, 2026 at 1:31 am

    You SHOULD check for user permission on server side.
    Problem with checksum is that the user can change the checksum as well as the ID – and can try to guess what you used for generating the checksum.
    So get the current user from session, get if the user is allowed to change the record from the database and refuse if it isn’t.

    As far as the optimizations go – you should optimize ONLY if it turns out to be slow.

    Or to quote an expert on the matter:

    In DonaldKnuth’s paper “StructuredProgrammingWithGoToStatements”, he wrote: “Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm getting a strange problem while inserting records into database. In my button
While working a project tonight, I ended up using one .js resource file for
I'm try to access a database which was working fine (until i added more
I have a working query that will return some results(records) from my database, like:
I have one App working with the dataabase in which the organisation column having
I have a database table with N records, each of which needs to be
While working with ssh I sometimes write to long string/commands eg. command -param 3
While working on something non-development related, I noticed something interested while on answers.com .
While working on my final project for my AS/400 Course, I encountered this problem
While working my way through the Android tutorials, I came across something I don't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.