speedy33417 Posted September 16, 2006 Share Posted September 16, 2006 Quick question. How do you assign value to a variable based on which link the user clicks. One of the pages where I would use it is a photo gallery page. Clicking on a thumbpic would save the album_id in a variable then process the page based on that variable. album_view.php checks if there's a value assigned to the variable. If not that means it will display the main gallery, if there's a value assigned to it then it will display that sub-gallery.Thanks. Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted September 16, 2006 Share Posted September 16, 2006 JavaScript can do that with the onClick() function Quote Link to comment Share on other sites More sharing options...
448191 Posted September 16, 2006 Share Posted September 16, 2006 [quote author=speedy33417 link=topic=108282.msg435456#msg435456 date=1158407669]Quick question. How do you assign value to a variable based on which link the user clicks. One of the pages where I would use it is a photo gallery page. Clicking on a thumbpic would save the album_id in a variable then process the page based on that variable. album_view.php checks if there's a value assigned to the variable. If not that means it will display the main gallery, if there's a value assigned to it then it will display that sub-gallery.Thanks.[/quote]You can't use onclick to set php variables, unless you have an ajax implementation.The most obvious solution is [url=http://www.plus2net.com/php_tutorial/variables2.php]passing variables though 'get'[/url]. Quote Link to comment Share on other sites More sharing options...
ronverdonk Posted September 16, 2006 Share Posted September 16, 2006 Sorry, that was stupid of me. I (almost automatically) think in Ajax terms. 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.