This maybe be repeated becuase I sent the first message via
Geo Crawlere and don't know how long they are going to take
to review the message. Sorry if it comes in twice.

I am writing a simple PerlTransHandler that is going to change
the request into another with query string.
The following is what I am looking for

/articles/10/index.html  =>  /articles/index.html?id=10

This is what I tried.

sub handler {
    my $r = shift;
    my $uri = $r->uri;

    my ($id) = ($uri =~ m|^/articles/(.*?)/|);
    my $newuri = $r->document_root . "/articles/index.html";
    my $uriobj = $r->parsed_uri;
    $uriobj->query("id=$id");
    $r->uri($newuri);

    return OK;
}

1;

All .html documents are being parsed by Embperl and that
works fine.

In my document $fdat{id} doesn't return anything as I think
it should be returing 10.

printing out Apache->request->parsed_uri->query in the
Embperl document doesn't print anything.

In the book there only one sentece about using the query()
method. and even that doesn't explain how to set up key=value
to return it later.

Any help is appreciated.

Ajay
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

Reply via email to