Re: [PHPLIB] Problem with "$sess->padd_query()" From: Florian Dittmer (nuku <email protected>)
Date: 03/31/00

Hi,

>From the manual:

###########################

add_query($qarray)

 Return string to be appended to the current URL for parameters
 in GET query format. Intended usage is like this:

###########################

The Query is added to the CURRENT url, not to the url you specify with the
purl("/") command (in your example).

Well, I ran ito problems with this too, and this is how I solved it (some may
say this is not a very goot "code", but well, I am new with php too - and it
works for me ;)

#################################

$sess->purl("form.php3"); # print the url (if req. with session parameter!)

if(strlen(strpos($sess->url("form.php3"),"?"))) { print "&"; } else { print
"?"; }; # print a "?" or "&"

print "myparameter1=$value1&myparameter2=$value2";

#####################

so you will get the output:
form.php3?myparameter1=value1&myparameter2=value2
OR
form.php3?session_id=32523523534534&myparameter1=value1&myparameter2=value2

greetings

florian

Am Fre, 31 Mär 2000 schrieb Milen A. Radev:
> Have anyone used this function from Session class add_query() (or
> padd_query())?
> I made a site without knowing about its existence. I use cookies in my
> browser.
> I used the following expression: <a href="<? $sess->purl("/?tologout=yes")
> ?>">Log-Out</a>
> And I got the following URI: http://www.mydomain.com/?tologout=yes
> which is what I need.
>
> Today I found it in PHPLib docs and I tried to use it. Because I want to
> made my
> site accessible with turned off cookies.
> But when I rewrote the example above to the following:
> <a href="<? $sess->purl("/").$sess->padd_query(array("tologout"=>"yes"))
> ?>">Log-Out</a>
>
> I get this URI: http://www.mydomain.com/&tologout=yes
> which (obviously) is incorrect.
>
> May be I don't use it the right way?
>
> Milen A. Radev
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Talk to your friends online with Yahoo! Messenger.
> http://im.yahoo.com
>
> -
> 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.

-- 
Florian Dittmer 

eMail: nuku <email protected> Web : http://www.nuku.de - http://www.zork.nu Chat : nukunuku97 (aim) - 2901888 (icq) - nuku (ircnet) - 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.