user6568979 user6568979 - 1 year ago 103
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download