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.
In reply to Detect CGI page caller by Only1KW
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |