Re: Re: Calling a function from a hyperlink
| From: | kaizer boab | Date: | Sat, 10 Jan 2004 14:54:55 +0000 |
| Subject: | Re: Re: Calling a function from a hyperlink | ||
| References: | 1 2 3 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-22550@lists.php.net to get a copy of this message | ||
Thanks Stuart,
I'll give that a try.
"Stuart" <lists@sharedserver.net> wrote in message
news:40001201.1020200@sharedserver.net...
> kaizer boab wrote:
> > The problem I have is this:
> >
> > I have built a shopping cart using a session. I have an addItem()
function,
> > and I was wondering if it were possible to call this function using a
> > hyperlink.
> > At the moment when a user clicks to add an item they are directed to the
> > "add.php" page as below:
> >
> > <a href=\"add.php?dvd_no={$row['dvd_no']}\">+</a>
> >
> > I want to have my addItem() function in all shopping pages but I only
want
> > it accessed via a link. Is this possible?
>
> Create an include file that checks $_GET for a particular variable. If
> it's there call addItem, if not do nothing. Then include that file in
> all pages that need to handle adding items.
>
> --
> Stuart