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