Updated PHP to work with button click

Not sure if working