Passing Session Data on an href link

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Pacey

    #1

    Passing Session Data on an href link

    Hi,
    I have a web page that gets info from a mySQL database for various
    items, and slaps that info, along with pics onto the page. ( in a
    shopping site stylee) The pics have an href link, and I want just one
    display page that all the pics refer to, so that any items pic and
    info can be viewed on its own. I therefore need a way of capturing the
    pic info into a session variable when the link is clicked, so that I
    can pull the individual item back out on the display page. Any ideas
    how I achieve it ??
  • Pedro Graca

    #2
    Re: Passing Session Data on an href link

    Mark Pacey wrote:[color=blue]
    > I have a web page that gets info from a mySQL database for various
    > items, and slaps that info, along with pics onto the page. ( in a
    > shopping site stylee) The pics have an href link, and I want just one
    > display page that all the pics refer to, so that any items pic and
    > info can be viewed on its own. I therefore need a way of capturing the
    > pic info into a session variable when the link is clicked,[/color]

    No can do.
    [color=blue]
    > so that I
    > can pull the individual item back out on the display page. Any ideas
    > how I achieve it ??[/color]

    Use information inside the URL (in $_GET, not in $_SESSION):

    <a href="iteminfo. php?id=834"><im g src="pic834.jpg " alt="item 834"/></a>

    When the user clicks this image the iteminfo.php script will run and you
    can use $_GET['id'] to know what picture was clicked. You can put that
    value in the session variables if you need it for other scripts.

    --
    USENET would be a better place if everybody read: : mail address :
    http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
    http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
    http://www.expita.com/nomime.html : to 10K bytes :

    Comment

    • Mark Pacey

      #3
      Re: Passing Session Data on an href link

      Pedro Graca <hexkid@hotpop. com> wrote in message news:<2g74ngF5b 4kaU1@uni-berlin.de>...[color=blue]
      > Mark Pacey wrote:[color=green]
      > > I have a web page that gets info from a mySQL database for various
      > > items, and slaps that info, along with pics onto the page. ( in a
      > > shopping site stylee) The pics have an href link, and I want just one
      > > display page that all the pics refer to, so that any items pic and
      > > info can be viewed on its own. I therefore need a way of capturing the
      > > pic info into a session variable when the link is clicked,[/color]
      >
      > No can do.
      >[color=green]
      > > so that I
      > > can pull the individual item back out on the display page. Any ideas
      > > how I achieve it ??[/color]
      >
      > Use information inside the URL (in $_GET, not in $_SESSION):
      >
      > <a href="iteminfo. php?id=834"><im g src="pic834.jpg " alt="item 834"/></a>
      >
      > When the user clicks this image the iteminfo.php script will run and you
      > can use $_GET['id'] to know what picture was clicked. You can put that
      > value in the session variables if you need it for other scripts.[/color]

      That works just great. How easy was that ??? You just know I wish I
      hadn't spent 10Hrs today trying to figure out how to do it with a
      session.
      You live and learn........ev entually. Many Thanks

      Comment

      • Pedro Graca

        #4
        Re: Passing Session Data on an href link

        Mark Pacey wrote:[color=blue]
        > Pedro Graca <hexkid@hotpop. com> wrote in message news:<2g74ngF5b 4kaU1@uni-berlin.de>...[color=green]
        >> <a href="iteminfo. php?id=834"><im g src="pic834.jpg " alt="item 834"/></a>[/color][/color]
        [color=blue]
        > That works just great.[/color]

        Thanks for the feedback.
        [color=blue]
        > Many Thanks[/color]

        You're very welcome.

        --
        USENET would be a better place if everybody read: : mail address :
        http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
        http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
        http://www.expita.com/nomime.html : to 10K bytes :

        Comment

        Working...