I've been creating a web app and one example of something it does is create golf rounds. Everything I've done works but I have been doing some testing and the way im passing variables through to my ajax call means the user could update anyone's round.
Currently I have a table that shows you your round and you can select the view button which will open a modal form to show details of that round.
This is my HTML
<button
type="button"
id="view-round"
class="btn btn-outline-primary btn-square btn-skew pull-right"
attr-id="39"
>View</button>
This is my jquery
$('body').on('click', '#view-round', function () {
var id = $(this).attr('attr-id');
$.post('/dashboard/pages/golf/round/ajax.php?action=load', {id: id}, function(response) {
//code in here
}
});
You can see from this that I'm passing through the round id via the attribute on the button "attr-id".
What I'm asking is can I put this variable somewhere someone couldn't edit it via the developer console etc.
I'm currently changing the ajax calls so that you can only update/look at your own records but really I'd like to stop it from being changed all together.