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 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(); ?> 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
Archived
This topic is now archived and is closed to further replies.