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 ? Quote Link to comment 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. } ?> Quote Link to comment 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 ? Quote Link to comment Share on other sites More sharing options...
trq Posted October 18, 2007 Share Posted October 18, 2007 Post your code for the menu. Quote Link to comment 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 Quote Link to comment 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.