Hello, while looking for a solution to a problem in my code i came across hidden values .
Now in my code the user enters a username which I enter in the database in an account_info table
I want to pass the username to another page where I can insert it in another table called patient_info
But I’m not sure how to use hidden values in a correct syntax.
So if I were to load your page, open the browsers dev tools and change the hidden inputs value to “valentinayounes” and submit, there would not be any problems?
You could continue to use GET or POST after initial validation and authentication, but IMHO doing so should only be when security and data integrity are of little to no concern.
Seeing “patient” in your example concerns me. Unless this is for some type of personal use only script be forewarned that medical data, like financial data, has strict restrictions and violations can result in severe penalties. If you are developing a DIY script intended for public consumption I advise you to abandon the idea.
That said, I think what you are looking for is $_SESSION
This whole concept is wrong and violates Database Normalization and the proper use of a Relational Database. You DO NOT duplicate data. Look up and learn Database Normalization.