The result of this is returned by the server as values set as URL fragment, example:
From my perl script how do I access this information to figure out what button the user has clicked?
Below is the part of the perl code that creates the iframe:
*****************************************************
print "Content-type: text/html\n\n";
print <<"EOF";
<html>
<body>
<p> You must first grant hostname to READ your data </p>
<br>
<iframe src="$finalRedirectURL" width="60%" height="50%" name="Consent Form" scrolling=no></iframe>
</body>
</html>
*****************************************************************
the src="$finalRedirectURL", is the url of the server that is throwing the page with agree/deny option and throwing result as part of URL
<form ACTION=submitform.pl METHOD=post>
or
<form ACTION=submitform.pl METHOD=get>
With "post" then the form data is passed invisibly to your script. With "get" the form data is passed through the url (e.g., [domain.com?submit=accept)....] Both have their advantages and disadvantages, but "post" is a lot more common.
If you don't have an "action" parameter in your <form>, then you're never actually sending the form back to the server.
I am using the functionality provided by this server, by including its server provided redirect url in an iframe, and the server is throwing back the response to me in an URL fragment (as I had mentioned earlier). My issue is that I dont know how to access this URL fragment from my perl code (I do see on my browser address window the response url 'http://<host>/#*$!.cgi#RESPONSE')
I used javascript to check for the URL fragment, and according to the response given by the server in the URL fragment, my code branches accordingly:
in the perl script.....
print <<"EOF";
<html>
<head>
<script type="text/javascript" language="JavaScript">
var lastId = "";
function checkForMessages(){
if(location.hash!= lastId){
lastId = location.hash;
document.getElementById("output").innerHTML = lastId;
if (lastId == "#CONSENTDONE") {
setTimeout('goRedirect()',1000);
}
else {
setTimeout('goBack()',1000);
}
}
}
setInterval(checkForMessages, 200);