Solved

Set Cookie then route to other page ?

Posted on 2000-03-12
5
149 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

760 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

26 Experts available now in Live!

Get 1:1 Help Now