auto redirect

hi experts,
after a user filled in my form, i always show him the filled information and ask him to click back:

my code:

print <<HEADER;
<html>
<head>
<title>
Question
</title>
</head>

<BODY background=/server.gif bgcolor="#ffffff"
  text="#000066" links="#000099" vlink="#000099" alink="#660099">

<br clear=all>

<br><code>
<p>$name, thank you for sharing your opinion with us on the subject $title. <br>

<p>You may go back and see the updated database on the disscusion list by clicking the LIST button</p>
<a href="http://www.eee.hku.hk/~lhui/titles.html">LIST</a>
<br>

</code>
</body>
</html>
HEADER


now I would like to change it to that
after showing his information, it will automatically load to the destination page.
how can i do that?

Thanks,

mwhuen
mwhuenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
<head><META HTTP-EQUIV="REFRESH" CONTENT="5" URL="http://www.eee.hku.hk/~lhui/titles.html">
0
maneshrCommented:
you can do it in one of the foll ways.

you can wait for some time and show a message to the user and then redirect to the other site (comment line 12 and uncomment line 8 and 9)

or you can just directly throw the user to the site
(uncomment line 12 and comment lines 8 and 9)

  +1   #!/usr/local/bin/perl
    +2
    +3   use CGI;
    +4
    +5   $query=new CGI;
    +6
    +7   if ($query->param){  ## The form has been submitted by user
    +8      #print "Content-type: text/html\n\n";
    +9      #print "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"5; URL=\http://www.e
ee.hku.hk/~lhui/titles.html\">";
   +10
   +11      ## OR you do directly throw the user to a seperate URL
   +12      print "Location: http://www.eee.hku.hk/~lhui/titles.html\n\n";
   +13      exit;
   +14   }
   +15
   +16   print "Content-type: text/html\n\n";
   +17   print "<FORM ACTION=\"".$ENV{SCRIPT_NAME}."\"METHOD=POST>\n";
   +18   print "Enter anything in the text box: <INPUT TYPE=TEXT NAME=text_mess
age VALUE=\"\">\n";
   +19   print "<P><INPUT TYPE=SUBMIT VALUE=\"Submit Now!!\">\n";
   +20
   +21   print "</FORM>\n";
0
ndnetCommented:
this little chunk of code is one i've found handy. It's on C-Net. It uses the best possible redirect on a per-browser basis, and degrades gracefully.


ex)

<HEAD>
<SCRIPT language="JavaScript1.1">
<!--
location.replace("http://www.yourserver.com/dir/file.ext");
//-->
</SCRIPT>
<NOSCRIPT>
<META http-equiv="Refresh" content="0; URL=http://www.yourserver.com/dir/file.ext">
</NOSCRIPT>
</HEAD>

Just add a link in the body and you're done.

However, this could also be done with SSI, just include the page in:

ex)

<\!--\#include virtual=\"\/myndnet\/dir.txt\" -->

This will work on any non-excutable, non-binary file.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

mwhuenAuthor Commented:

In fact, the code I listed in my question is from my cgi file.
In the cgi program, I want to show
"
<html>
<head>
<title>
Question
</title>
</head>
<BODY background=/server.gif bgcolor="#ffffff"
  text="#000066" links="#000099" vlink="#000099" alink="#660099">
<br clear=all>
<br><code>
<p>$name, thank you for sharing your opinion with us on the subject $title. <br>
</code>
</body>
</html>
"

and after the user read this for 5 seconds, the brower will automatically redirect to another page, the LIST.html.

I have tried the ozo's method:

<head><META HTTP-EQUIV="REFRESH" CONTENT="5" URL="http://www.eee.hku.hk/~lhui/titles.html">
but after 5 seconds, it shows:
"I don't understand the Content-type."

I guess my cgi program may restart again, and check Content-type.

Why?
Please help!!!
:)

Thank
0
maneshrCommented:
try with the URL= within the content attribute...

<META HTTP-EQUIV="REFRESH" CONTENT="5; URL=http://www.eee.hku.hk/~lhui/titles.html">
0
mwhuenAuthor Commented:
yes, it works now, thank you all guys.
:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.