Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Set Cookie then route to other page ?

Posted on 2000-03-12
5
Medium Priority
?
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
fibdev earned 80 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

609 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