Re: [PHPLIB] $sess->url and $sess->add_query() From: Joel (comicsboy <email protected>)
Date: 11/29/99

Dear Shawn,

    Thanks for your kind help. However, the add_query() is actually my typo ^_^ (sorry for this).
Actually, I have tried both
<a href="<?$sess->purl("details.php3").$sess->padd_query(array("id"=>"10","page"=>"1"))?>">TESTURL</a>
&
<a href="<?echo $sess->url("details.php3").$sess->add_query(array("id"=>10,"page"=>"1"))?>"TESTURL</a>
but still get the error. Any idea? There isn't any problem when it is in get mode or the current url is
not passed with get variables.
eg, URL:http://www.abc.com/index.php3
got no problem, but if the current url like this
eg, URL:http://www.abc.com/index.php3?id=10
then all hyperlinks in this index.php3 will become incorrect
eg, next page = http://www.abc.com/details.php3&page=1
it is the '&' sign causing the problem. I don't know why it can't passed with '?' in this case.
Absolutely, there isn't any problem if it is in fallback mode. I am now really in trouble.

Yours regard,
Joel

Shawn Patton wrote:

> Joel,
>
> Try quoting your string argument passed to purl("path/file") and
> use padd_query() instead of add_query(). So in your example you would
> have:
>
> <a href="<?$sess->purl("details.php3?page=1").$sess->padd_query(array("id"=>"10"))?>">TEST URL</a>
>
> or, instead of passing the var => val pair in the purl() arg, try passing them in the padd_query(),
> like:
>
> <a href="<?$sess->purl("details.php3").$sess->padd_query(array("id"=>"10","page"=>1))?>">TESTURL</a>
>
> or pass the $array name to padd_query:
>
> $myarray["id"] = 10;
> $myarray["page"] = 1;
>
> <a href="<?$sess->purl("details.php3").$sess->padd_query($myarray))?>">TESTURL</a>
>
> -Shawn
>
> Joel wrote:
>
> > Dear all,
> >
> > I have found a strange problem about the $sess->url(). My code like
> > this,
> > <a
> > href="<?$sess->purl(/test/test.php3).$sess->add_query(array("id"=>"10"))?>">
> >
> > TEST URL</a>
> > When the current url is clear (ie, no parameter passed with get
> > method, eg. /index.php3), there is no problem at all. However, when the
> > current url like this, /details.php3?page=1, then all url in this page
> > will not get the "?". For example, next page hyper link will appear as
> > something like this, /details.php3&page=2. It therefore gives me an
> > error: file not found. Please help. Thanks in advance
> >
> > Yours regard,
> > Joel
> >
> > -
> > PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> > To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> > the body, not the subject, of your message.
>
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.

-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.