I have a question for php. I am sure it has already answered but I can’t express it to search.
So, I have a page which is actually a user profile. In this page there is a button.
When I press this key I want somehow to take the id of the user the the profile belongs.
I think in jsp you can do this with Request object, but I am not sure.
If it’s a form submit put the user id in a hidden input on the page. Something like:
Then when you click the button to submit your form it will be available in the variable
$_POST['user_id']if you used the POST method or$_GET['user_id']if you used the GET method.If you want to do it without submitting a form you probably need to use Javascript to make an AJAX call.