i have made a formin which i have three buttons save,delete,update i want to check which button is check by user in a php file how can i do that if any body has idea of it please let me know thnx alot also i want to use switch statement.
switch($_GET['button']) { case "save": echo "Save Used"; break; case "delete": echo "delete Used"; break; case "update": echo "Update Used"; break; } Depends if you are using Get or Post. Make sure all your buttons have the same name but change the value to , save, delete and update. Should work.
otherwise if you are not willing to use values for whatever reason (you might have multilanguage layout or some other random stuff) you can just do like this: if ($_POST['update']) { echo 'update used'; } elseif ($_POST['delete']) { echo 'delete used'; } your submit buttons would look like <input type="submit" value="Whatever you need to be here, update" name="update" /> <input type="submit" value="Whatever you need to be here, delete" name="delete" />