Jump to content

value assigning


speedy33417

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.