Solved

Set Cookie then route to other page ?

Posted on 2000-03-12
5
150 Views
Last Modified: 2013-12-25
Hi ! I'm using Perl, to set a cookie. After setting the cookie I want to route to another page but this doesn't work because the Browser interprets Location: http://www.anyserver... as text. Any idea which works with ANY Browser ?

regards
ItsMe
0
Comment
Question by:ItsMe
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
fibdev earned 20 total points
ID: 2609391
This is easy!  :)
Put this in your cgi script ...

#!/usr/bin/perl
#
print "Content-type:text/html\n";
print "Refresh:3; # change this number for how many seconds to wait. URL=http://www.yoursite.com/newpage.htm\n\n";

#  (handle form stuff or whatever you want your CGI to do here ie: set the cookie)

# then print the redirect for old browsers, with META tag:

print <<EndHTML;
<html><head>
<title>Working ...</title>
</head>
<body>
The page you have requested have been moved<a href="http://www.yoursite.com/newpage.htm/">here</a>.<p>
</body>
</html>
EndHTML
0
 

Author Comment

by:ItsMe
ID: 2609425
I thougt of this, too. Does all Browsers support this Meta Tah (even MS-DOS Browsers) ? If, it would be enough to use the META tag ...
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2609442
This method will work on ns and ie 3x and up browsers.  I don't know about other browsers, but with the link, it will give you something to fall back on.
0
 
LVL 3

Expert Comment

by:fibdev
ID: 2609443
you could place javascript into the the heading of the page, but even then, the older browsers won't support it.
0
 

Author Comment

by:ItsMe
ID: 2609577
Thanks :-)
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now