Re: [phplib] Problem with $sess->url($PHP_SELF) From: R.B. Scholtus (regiment <email protected>)
Date: 09/11/00

> $edit = $sess->url($PHP_SELF) . $sess->add_query ( array("edit"=>"Edit
> magazine" ,"magazine_id"=>($db->f("magazine_id"))));

Wouldn't it be a lot easier to use:

$edit =
$sess->url($PHP_SELF."?edit=Edit_magazine&magazine_id=".$db->f("magazine_id"
));

will result in:

page.html?edit=Edit_magazine&magazine_id=1
or:
page.html?edit=Edit_magazine&magazine_id=1&session=kagfkgeAgw98rege3g9IG76kj
3h42efe25

Put everything inside $sess->url(.......)
$sess->url() checks of something is appended to the url already, so it knows
if it should add a ? or & with the session id if in GET mode.

$sess->add_query() uses $QUERY_STRING i believe, i never use it.

Brian

----- Original Message -----
From: "Thai Thanh Ha" <thaiha <email protected>>
To: <phplib <email protected>>
Sent: Monday, September 11, 2000 12:02 PM
Subject: [phplib] Problem with $sess->url($PHP_SELF)

> Hi,
>
> I has the following code:
>
> $edit = $sess->url($PHP_SELF) . $sess->add_query ( array("edit"=>"Edit
> magazine" ,"magazine_id"=>($db->f("magazine_id"))));
>
> But sometimes $edit has the value :
> "magazines.php&delete=Delete+magazine&magazine_id=20"
> (without "?" after "magazines.php") so that IE will return "HTTP 404 Not
> found".
>
> My program has some functions: Add, Delete. I use POST method for Add
> function (a form with property method=POST) and GET method for Delete (
the
> above link).
>
> Please help me!
>
> Thai
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>