RE: [PHP] URIs as variables
| From: | Jeff Armstrong | Date: | Thu, 22 Mar 2001 12:09:08 +0000 |
| Subject: | RE: [PHP] URIs as variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45103@lists.php.net to get a copy of this message | ||
Instead of using a HIDDEN form field (I assume you don't
use this in any client side javascript), why not just use
a session variable. Add this to the top of the relevant
pages using include:
<?php
session_start();
# This array contains all the session items
if (!isset($sesh)) {
$sesh = array();
session_register('sesh');
}
if (isset($url) and !$sesh[url])
$sesh[url] = $url;
?>
You can then use $sesh[url] in any php block to find
what this value was set to on the first page.
Regards
Jeff
-----Original Message-----
From: Issac Goldstand [mailto:neoi@writeme.com]
Sent: Thursday, March 22, 2001 11:39 AM
To: php-general@lists.php.net
Subject: Re: [PHP] URIs as variables
Nope. That gave me:
<INPUT TYPE="HIDDEN" NAME="url"
VALUE="script2.php?var1=a&b">
I'd need to enumerate $HTTP_GET_VARS variable _keys_ too, but I don't know
how...
Also, how can I get it to work for both GET & POST methods? Is that
possible?
Thanks,
Issac
""almir"" <a.kazazic@medienhaus.co.at> wrote in message
news:99b66u$q0o$1@toye.p.sourceforge.net...
> try with
>
> uri=<? echo implode("&", $HTTP_GET_VARS);?>
>
>
> ""Issac Goldstand"" <neoi@writeme.com> schrieb im Newsbeitrag
> news:99at42$5be$1@toye.p.sourceforge.net...
> > Newbie question here. I am trying to pass a varaible containing a URI
> > across a few scripts. Basically, the first script get's a query string
> > including the URI (eg
> >
> > http://foo.bar/script1.php?url=script2.php?var1=a&var2=b).
> > Now, script1 contains a form pointing to script3 so basically, I have
the
> > user form and then:
> >
> > <?
> > echo "<INPUT TYPE=\"HIDDEN\" NAME=\"url\"
> > VALUE=\"$url\">";
> > ?>
> >
> > (I have register-gloabls enabled and am not sure whether the call to
> script1
> > will be POST or GET)
> >
> > This creates a slight problem, as, using the above example once again,
PHP
> > will send the browser the line:
> >
> > <INPUT TYPE="HIDDEN" NAME="url"
> > VALUE="script2.php?var1=a">
> >
> > But it totally chops off everything from the "&" and onwards. How can I
> fix
> > it to get the entire URI?
> >
> > Thanks,
> > Issac
> >
> >
> > --
> > Internet is a wonderful mechanism for making a fool of
> > yourself in front of a very large audience.
> > --Anonymous
> >
> > Moving the mouse won't get you into trouble... Clicking it might.
> > --Anonymous
> >
> > PGP Key 0xE0FA561B - Fingerprint:
> > 7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net