Re: passing a variable between URL's
| From: | CPT John W. Holmes | Date: | Tue, 15 Apr 2003 19:45:54 +0000 |
| Subject: | Re: passing a variable between URL's | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144012@lists.php.net to get a copy of this message | ||
> somerandomsite.org/pageA.php has a link to somerandomsite.org/pageB.php
>
> when a user clicks on the link in pageA.php, I want to set a variable
> and pass it to pageB.php.
>
> I have seached the docs and the only two solutions I can come up with
> are the use HTTP GETS or cookies. Any other solutions? Is any one
> solution better than the others?
As for actually clicking on a link and setting a variable (only when that
link is clicked), then you need to use the GET method of attaching the
variable onto the end of the URL. You can _set_ variables in a cookie or
session on PageA that'll be available on PageB, though, but you don't know
the method that the user actually used to get to PageB.
> Also, my assumption is that PHP handles regular expressions. Any
> documentation on that? So far the PHP docs have yeilded few clues in
> the subject.
There are two chapters in the manual, each called, umm.. REGULAR EXPRESSION
FUNCTIONS. :) Might be a good place to start.
They explain the basics, then any tutorial on regular expressions will help
you understand them more. Take the time to learn the Perl-compatible regex,
they are faster.
---John Holmes...