I am trying to pass an id from a button in page1 to a variable that's in php in page2. The id is dynamic because there will be multiple buttons and i only need to send the clicked button id. The problem is I don't know where to start really. Do I need to use cookies? I have read some people use sessions but that is a bit overkill I think.
This is the button in page1
<td class="button-table">
<button class="leads-more-info-btn"
id="<?php echo $leadKey = $allIssues->key ?>"
onclick="sendData(this.id)">Apply..
</button>
</td>
As you can see i tried using the onclick
, but that is in javascript. I would like to do it in php.
And the variable name in Page2 is called $currentLead
. So to summarize page1:buttonID->page2:$currentLead
.