Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How can I pass the URL of the page I am on?

by cianoz (Friar)
on Oct 10, 2000 at 21:25 UTC ( [id://36082]=note: print w/replies, xml ) Need Help??


in reply to How can I pass the URL of the page I am on?

...and if you can't use forms then:
use URI::Escape; my $url = $query->self_url; $url = uri_escape($url); # or $query->url; it depends.. print qq{<a href="/path/to/new/location.pl?URL=$url">new location</a>} +;

Replies are listed 'Best First'.
RE: Answer: How can I pass the URL of the page I am on?
by merlyn (Sage) on Oct 10, 2000 at 22:19 UTC
    The result of self_url is already URI-escaped, but if you're feeding it as HTML, you need to additionally HTML-entitize it.
    use HTML::Entities; my $url = encode_entities(CGI->self_url()); print qq{<a href="/path/to/new/location.pl?URL=$url">new location</a>} +;

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://36082]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-25 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found