Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: keep get param from url even if page reload

by FreeBeerReekingMonk (Deacon)
on Jan 24, 2019 at 23:15 UTC ( [id://1228950]=note: print w/replies, xml ) Need Help??


in reply to keep get param from url even if page reload

Ok, What I think is happening is that you click submit and that is a POST, and the reload is a GET.

For POST requests, the param("id") function will return the parameters from the postdata, but any parameters specified via a query string in the URL is available from the url_param("id"). Maybe you have a FORM that also has the id, or defines it, and it's empty?

For GET requests, when you reload the page, CGI parses the specified parameters and makes them available via the param() method.

So try url_param("id")

  • Comment on Re: keep get param from url even if page reload

Replies are listed 'Best First'.
Re^2: keep get param from url even if page reload
by bigup401 (Pilgrim) on Jan 25, 2019 at 09:37 UTC

    thanks, your idea has worked for me

Re^2: keep get param from url even if page reload
by bigup401 (Pilgrim) on Jan 25, 2019 at 09:37 UTC

    thanks

Log In?
Username:
Password:

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

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

    No recent polls found