Jump to content


Photo

value assigning


  • Please log in to reply
3 replies to this topic

#1 speedy33417

speedy33417
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 16 September 2006 - 11:54 AM

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.

#2 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 16 September 2006 - 12:31 PM

JavaScript can do that with the onClick() function
RTFM is an almost extinct art form, it should be subsidized.

#3 448191

448191
  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 16 September 2006 - 02:29 PM

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.


You can't use onclick to set php variables, unless you have an ajax implementation.

The most obvious solution is passing variables though 'get'.

#4 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 16 September 2006 - 03:45 PM

Sorry, that was stupid of me. I (almost automatically) think in Ajax terms.
RTFM is an almost extinct art form, it should be subsidized.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users