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
php update on a form button
Moderator: General Moderators
-
AXEmonster
- Forum Commoner
- Posts: 34
- Joined: Fri Sep 05, 2003 11:27 am
- Location: newcastle UK
-
matthiasone
- Forum Contributor
- Posts: 117
- Joined: Mon Jul 22, 2002 12:14 pm
- Location: Texas, USA
- Contact:
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...';
}
?>-
AXEmonster
- Forum Commoner
- Posts: 34
- Joined: Fri Sep 05, 2003 11:27 am
- Location: newcastle UK
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
there is a ref number which will be held in a variable (hidden field) so i can use that value in my where clause