In whatever page you are going to after you press the buttons...
Name the buttons different things so when you press on one to submit the form, you can switch on that name. OR you can use the button as your input type and just go to URL using javascript and pass the argument in the URI. I suggest using the latter.
<input type=button value="button 1" onClick=goTo('page.php?button=1')>
<script language=javascript>
function goTo(url){
window.location.href = url;
}
</script>
Then in the destination page.
switch($_GET[button]){
case 1:
$sql = "query 1";
break;
case 2:
$sql = "query 2";
break;
}
mysql_query($sql);
This is all extremely basic logic. I doubt we are seeing anything new here, but you were more than likely having issues putting the logic together.
The best way to do this is figure out where you want to be. Then decide on a way to do that. Then work on how to get there. It doesnt have to be perfect, nor does it have to work the first time, and you can always change it later. But if you do not understand the process to follow and create logic, we will be seeing much more of you around here.
__________________
I rarely give code examples.
No, I have never used IIS or Windows of any kind as a web server. Get a real OS!
Please don't PM me, I won't respond.
|