Home
TeamSite
redirecting from CGI
megamala
I need to redirect to webpage from CGI script. From browser if call cgi script ../.../test.cgi. Then I need to redirect to yahoo or hotmail.
ex.
../../test.cgi?url=xxxx
test.cgi has to take the url parameter and redirect to xxxx web page
TIA
MM
MM Guptha
Find more posts tagged with
Comments
megamala
I got it by
print "Location:
www.****.com\n\n";
MM Guptha
Herman
I use your way but page doesn't redirect to another page,
it just print out the string (Location:
www.****.com
),
how can i redirect to another page?
Lal
The best way is to use HTML metatag inside the teamsite TPL
eg:
<meta http-equiv="refresh" content="2;url=
http://webdesign.about.com/">
Lal
Edited by Lal on 09/16/05 04:13 AM (server time).
Herman
this way will direct to another page right, <meta http-equiv="refresh" content="2;url=
http://webdesign.about.com/">
but i want to click a button,then redirect to another page,
any idea?
ratzz
From where r u calling this cgi script and from where do u get the url parameter?
ISCBorisB
You are a bit vague here...
What is the page that contains your buttons ?
Are you producing it with CGI getting multiple target URL's from wherever ?
Be it as it may, it's easy to do with Javascript.
The following sample shows one of the many ways to do it.
<html>
<head>
<title>get to URLs</title>
<script type="text/javascript" language="javascript">
<!--
function get_to_page(pURL) {
var newWindow = window.open(pURL,"","width=600,height=400,status=yes,toolbar=yes,location=yes,resizable=yes,scrollbars=yes,left=75,top=50");
}
-->
</script>
</head>
<body>
<input type="button" value=" Get to Yahoo "
onClick="get_to_page('
http://www.yahoo.com');"><br>
<input type="button" value=" Get to Google "
onClick="get_to_page('
http://www.google.com');"><br>
<input type="button" value=" Get to DevNet "
onClick="get_to_page('
http://devnet.interwoven.com/site.fcgi');">
</body>
</html>
Hope that helps
akshathp
You could use a form to do this.
Just add a form in your html that will have a button. In the action item of form element you can specify the target page.
Akshat Pramod Sharma