Page 1 of 1

php update on a form button

Posted: Fri Sep 05, 2003 11:27 am
by AXEmonster
i am new to this guys

i want to update a field (mysql) using only a button (no form fields) the values will be gathered from a hidden field

how do i write this

Posted: Fri Sep 05, 2003 11:33 am
by matthiasone
Are you wanting the html form code or the query code?

Posted: Fri Sep 05, 2003 5:37 pm
by JAM

Code: Select all

<?php
echo '
<form method="post">
 <input type="submit" name="name" value="Send">
</form>
';

if (isset($_POST['name'])) {
 // you database layer goes here
 mysql_query("update table set field = field+1");
 echo 'Updating something...';
}
?>

Posted: Sat Sep 06, 2003 5:46 am
by AXEmonster
basicaly it is to reject a record that i have called say a image of a form. if the form cant be matched to other data manually then the user will reject that image by clicking on the html button and by doing that an "R" will be inserted into the status field of the database

there is a ref number which will be held in a variable (hidden field) so i can use that value in my where clause