Run PHP on button click and hide download link

robe

New Member
With this code I want to turn it into when a user clicks on the button it first verifies that they want to download the file and if they click yes it subtracts 100 points from the $userpoints (and then update the mysql table, but I know how to do this), what I need help with is getting the code to run when someone clicks the button. Also I want to give them the download without them getting a url that they can reuse. Either by not showing them the url or making it a unique one time code.\[code\]<?phpif ($userpoints >= 100) { echo '<input type="button" value="http://stackoverflow.com/questions/15859258/100pts">';} else { echo '<input type="button" value="http://stackoverflow.com/questions/15859258/100pts" disabled title="You need at least 100 points for this download">'; }?>\[/code\]To be more clear here is what I would want to run when the user clicks the buttonask yes or no to verify download \[code\]mysqli_query($con,"UPDATE users SET points=points -100 WHERE users.user_name = '$username' LIMIT 1");\[/code\]if possible just start the download without giving a url or making click again
 
Back
Top