Hi Julietott,
You can accomplish what you're trying to do with a little javascript.
Here is a framework for a document that does what you want:
<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
var urltext = document.location.href;
if (urltext.indexOf('?') != -1)
targeturl = urltext.substring((urltext.indexOf('?')+1),urltext.length);
else
targeturl = document.location.href; // defaults to current page if no
parameter is passed
function init(){
document.forms[0].p_requested_url.value = targeturl;
}
//-->
</script>
</head>
<body onload="init()">
<form>
<input type="hidden" name="p_requested_url" value="">
</form>
</body>
</html>
To integrate this with your page, you just need to copy the javascript
portion into your document's head tags, and insert the onload event
handler into your body tag. The value in the hidden input field will
be overwritten when the page loads, so it can be left blank or set to
some default page URL.
Now, to call the page. If this page were located at:
://www.google.com/test.html
then you could pass the URL of your choice through the URL like so:
://www.google.com/test.html?http://www.blahblahblah.com
Basically what happens is that the javascript takes a look at the URL
of the page, and picks up that there is a querystring attached to the
end of it. It then strips off the querystring and stores it in a
variable. Then when the page (and more importantly, your form with
the hidden field) loads, the init function is called which sets the
value of your hidden field to the stored value.
Cheers,
Prophet |
Clarification of Answer by
prophet-ga
on
22 Feb 2003 08:07 PST
Hi Julietott,
What you did with the init() statement was correct. That should work
on both browsers in the same way. I believe the problem you're having
is because of the "base" tag. Netscape and IE tend to treat this tag
slightly differently. The base tag is useful if you want a reference
point for all other links on a page. However, you only have one link
in this page, namely the form's action. If this html page is located
on the same server and in the same folder as the form action, then
remove the base tag entirely. Otherwise, remove the base but take the
url "http://myserver.com/pls/portal30/" and stick it on the beginning
of the form action, like so:
"http://myserver.com/pls/portal30/PORTAL30.wwptl_login.login_url"
I've cleaned up the code below to reflect the latter. If that doesn't
work, try changing the form's action to
"PORTAL30.wwptl_login.login_url".
<html>
<head>
<title>Example Custom HTML Login</title>
<script language="JavaScript" type="text/javascript">
<!--
var urltext = document.location.href;
if (urltext.indexOf('?') != -1)
targeturl = urltext.substring((urltext.indexOf('?')+1),urltext.length);
else
targeturl = document.location.href; // defaults to current page if no
parameter is passed
function init(){
document.LoginForm.p_requested_url.value = targeturl;
document.LoginForm.submit();
}
//-->
</script>
</head>
<body onload="init()">
<form action="http://myserver.com/pls/portal30/PORTAL30.wwptl_login.login_url"
method="post" name="LoginForm">
<input type="hidden" name="p_requested_url" value="">
<input type="hidden" name="p_cancel_url" value="http://myserver.com">
<input type="hidden" name="ssousername" value="myuser">
<input type="hidden" name="password" value="mypasswd">
<input type="submit" value="Automatic Connection To Oracle Portal">
</form>
</body>
</html>
Hopefully this will do the trick. If you are still having problems,
please let me know and include the full url of the form's action that
you're trying to reach (you can substitute the domain name with
www.google.com or something if that makes you more comfortable).
Also, please include the version number of netscape are you using to
test compatibility. I tried the code above on Netscape 7 and IE 6 and
they seem to behave the same.
Good luck,
Prophet
|