Simply put, never trust anyone that the user can access.
Yes, someone can easily change these values, in fact they can send their own form to their page with any values, etc. that they want.
You better take the provided data (i.e. POST / GET) and first check the names and data for what it should be (i.e. strlen()
, regex for A-z0-9, possibly an array with all the valid data, and t .d.), and then when you are happy, all the data presented is valid, then get your prices from a database / other source based on the names of the forms.
Just placing them on the form, someone will change the price by 0.00 and get them for free. Thus, these are meaningless posting prices in the form, when you still have to check them from your own source (mysql, etc.).
James source share