blueman378 Posted December 25, 2007 Share Posted December 25, 2007 hi guys i am linking to a page called catprocess.php via catprocess.php$action=Delete or catprocess.php$action=Browse you get the idea, anyway i was wondering how would i preform different functions based on the $action variable? eg we have a function called browse, and one called delete, if action=delete preform delete function else if action = browse preform browse funxtion thanks btw i know i can use else ect but im looking for a tidier way thanks Quote Link to comment https://forums.phpfreaks.com/topic/83107-solved-writing-a-simple-php-processing-form/ Share on other sites More sharing options...
phpQuestioner Posted December 25, 2007 Share Posted December 25, 2007 <?php $action = $_GET['action']; if ($action == "browse") { function doSomething() { // browse script here echo "You Are Now Browsing"; } } else if ($action == "delete") { function doSomething() { // delete script here echo "Delete Complete"; } } else { function doSomething() { echo "No Action Specified!"; } } doSomething(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/83107-solved-writing-a-simple-php-processing-form/#findComment-422766 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.