Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening an html page from perl

Status
Not open for further replies.

EmyrPugh

Programmer
Jul 16, 2005
1
GB
I'm basically trying to set up some kind of user forum for my website, and I want the page to auto-refresh once a user has posted data. When the user posts his/her comments a separate perl script runs which processes their information. What I want to do is have that script run the original webpage once it's finished instead of just remaining on a new html page. I've tried using the LWP::Simple module and getprint(' but this doesn't quite work because the processing script is effectively still running. Is there some way to just finish up a script and have it load another script/html page as it ends?
 
you can print a redirect when you have completed processing

Code:
#!/usr/bin/perl
$q=new CGI;
...
 do processing
...
print $q->redirect('[URL unfurl="true"]http://mywebsite.domain/processed.html');[/URL]

HTH
--Paul

cigless ...
 
like Paul says or you can manually print a meta tag to refresh to a new page if you're not using CGI.pm for some reason.
 
Code:
<META HTTP-EQUIV="Refresh" CONTENT="3; URL=http://www.domain.co.uk/">

notice the number of seconds before the refresh


Kind Regards
Duncan
 
I am creating a form which processes a perl script and then I want to redirect it to another page.

I have the following code:
#!opt/bin/perl
use CGI qw:)standard);
$q=new CGI;
....
....
....
....
....
print "Thank you for your submission";
print $q->redirect('
But this doesnt seem to work. Could you point out why?
 
Try this
Code:
[COLOR=red]#use CGI qw(:standard);[/color]
use CGI;

I'm not sure, but it could be that the redirect isn't part of the standard export.

If you're printing a redirect, you shouldn't have printed anything else esp headers. This is most likely the problem
Code:
[COLOR=red]#print "Thank you for your submission";[/color]
print $q->redirect('[URL unfurl="true"]http://mywebsite.domain/success.html');[/URL]
HTH
--Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top