ashrafzia Posted October 18, 2007 Share Posted October 18, 2007 I have a javascript menu and i want to load the same page when the menu item is clicked but how can i recognise that, that specific item is clicked ? and then i can handle it by some check (if-else). For example: Students | V Add Students Del Students Search Students How to handle/recognise an event which is raised by clicking on the menu item ? Link to comment https://forums.phpfreaks.com/topic/73745-solved-recognising-events-from-menu-item/ Share on other sites More sharing options...
trq Posted October 18, 2007 Share Posted October 18, 2007 Pass a variable via the url, then simply check the $_GET array. eg; <?php if (isset($_GET['action'])) { $action = $_GET['action']; // now you can call specific functionality // based on the value in $action. } ?> Link to comment https://forums.phpfreaks.com/topic/73745-solved-recognising-events-from-menu-item/#findComment-372090 Share on other sites More sharing options...
ashrafzia Posted October 18, 2007 Author Share Posted October 18, 2007 Pass a variable via the url, then simply check the $_GET array. eg; <?php if (isset($_GET['action'])) { $action = $_GET['action']; // now you can call specific functionality // based on the value in $action. } ?> Can you please show me how to pass a variable via the url? any code example ? Link to comment https://forums.phpfreaks.com/topic/73745-solved-recognising-events-from-menu-item/#findComment-372100 Share on other sites More sharing options...
trq Posted October 18, 2007 Share Posted October 18, 2007 Post your code for the menu. Link to comment https://forums.phpfreaks.com/topic/73745-solved-recognising-events-from-menu-item/#findComment-372110 Share on other sites More sharing options...
ashrafzia Posted October 18, 2007 Author Share Posted October 18, 2007 Post your code for the menu. THANKS ALOT! I got it......Its DOne. I simply added a variable and its value to the link like: /students.php?id=RegisterStudent Link to comment https://forums.phpfreaks.com/topic/73745-solved-recognising-events-from-menu-item/#findComment-372188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.