Only1KW has asked for the wisdom of the Perl Monks concerning the following question:
I'm sorry if this has already been asked, but I can't find an answer to this question anywhere even though it should be a common problem.
I have a Perl/CGI page which I will call foo.cgi. In foo.cgi, I have a form which action is to submit back to foo.cgi (<FORM name='form1' method='post' action='foo.cgi'). When the page reloads, if I detect that the form was submitted, I validate the input and then, if necessary, send the data off to one of about 10 other CGI pages, depending on which option the user selected in the form. I will call one of these other CGI pages bar.cgi. I call bar.cgi using an HTML meta refresh and pass in variables in the URL string using the GET method (<META http-equiv='refresh' content='0; URL=bar.cgi?array1=value1&array1=value2'>).
My question is, how do I validate in bar.cgi that foo.cgi called it? I don't want users being able to call bar.cgi directly entering in any value for any variable they want in the URL. My only idea was to use the referer() method in the CGI package, but apparently that method doesn't find any value when a META refresh is used. Any other ideas? If there's a better way to call bar.cgi from foo.cgi, I'd be open to it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Detect CGI page caller
by bellaire (Hermit) on Mar 02, 2009 at 16:35 UTC | |
|
Re: Detect CGI page caller
by perrin (Chancellor) on Mar 02, 2009 at 17:17 UTC | |
|
Re: Detect CGI page caller
by hangon (Deacon) on Mar 02, 2009 at 16:44 UTC | |
|
Re: Detect CGI page caller
by jettero (Monsignor) on Mar 02, 2009 at 17:02 UTC | |
|
Re: Detect CGI page caller
by satanicpuppy (Novice) on Mar 02, 2009 at 21:42 UTC |