user6568979 user6568979 - 7 months ago 59
PHP Question

Php button handling

I have created a button, now i want to change a variable's value and pass into anothor php file when the button is pressed. I have tried to find some infirmation from google but couldn't find something useful. Can anyone help me to do this?


Lets suppose your button is a link such that

<a href="?set=1">Click here</a>

On click of this button when page would load get the query string parameter like below:

$var = "someValue";
if(isset($_GET['set']) && $_GET['set'] == true){
  $var = "ChangedValue";

and get the val in the other file.