Jump to content

Archived

This topic is now archived and is closed to further replies.

speedy33417

value assigning

Recommended Posts

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.

Share this post


Link to post
Share on other sites
[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].

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.