Forum Moderators: coopster & phranque

Message Too Old, No Replies

How do i redirect to a new script using perl

perl script redirection vs meta tag redirection

         

scotty28

5:10 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



Hi all,

I have a script that redirects to another script after displaying a short message. I used <meta http-equiv=\"refresh\" content = \"2; url=http://someurl.com/cgi-bin/somescript.pl?var1&var2\">.

The problem is this will not work in mozilla or netscape but works fine in IE. So what i really need is some way to perform the same action using perl. Does anybody have any suggestions?

thanks.

also. when i load the script that contains the redirect, the browser does not render the html it just shows the source code (i have never seen this before and think that it is rather strange, it renders perfectly in IE) The permissions on the file are fine and the html is good. Could the meta tag problem be the cause of this?

killroy

5:37 pm on Jul 8, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



did you output the proper headerS?

can you paste here the full output of your script (without urls of course)

It should work fine, but you can always use javascript .reload()

SN

scotty28

6:15 pm on Jul 8, 2003 (gmt 0)

10+ Year Member



This is the output i get in a mozilla or netscape browser:

<html>
<head>
<title>title here</title>
<LINK REL="stylesheet" TYPE = "text/css" HREF="../../styles.css">
<META HTTP-Equiv="Refresh" CONTENT="1; URL=http://xxx.xxx.xxx.xxx/cgi-bin/demo/myscript.pl?hpid=xxxx&password=xxxxxxxx">
</head>
<body>
<TABLE align=left width=680 border=1 cellpadding=3>
<TR>
<TD rowSpan=2 width=190 valign="top">
<IMG align=right alt="Welcome" src="../../images/entryLogoSmall.gif"> </TD>
<TD bgcolor="#4f60ft" width="490"><center><h3> Check Login</h3></center></td></tr>
<tr><td>

Validating ID and password .....</td></tr></table>

</body>
</html>

tschild

5:18 pm on Jul 9, 2003 (gmt 0)

10+ Year Member



also. when i load the script that contains the redirect, the browser does not render the html it just shows the source code (i have never seen this before and think that it is rather strange, it renders perfectly in IE) The permissions on the file are fine and the html is good. Could the meta tag problem be the cause of this?

This might point to the script not specifying "Content-Type: text/html" in the HTTP headers of the page it outputs.

Could you post either the HTTP headers (the part of the script's output that comes before the <html> and that's not included in the "show source" output of a browser), or the code that creates the output?

scotty28

5:21 pm on Jul 10, 2003 (gmt 0)

10+ Year Member



It was the "Content type: text/html" it was being called inside my header function. I placed a line of code above the function call which gave me the undesired results.

This also solved the redirect problem.

I should have seen that earlier.

Thanks tschild