CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
How to refresh a page in a perl script

 



datlaravi
Deleted

Jun 15, 2000, 1:31 PM

Post #1 of 8 (1067 views)
How to refresh a page in a perl script Can't Post

HI,
I have a perl script in which i had one subroutine which adds data to the database and also some drop downs which shows data(the updated data). After i call the subroutine, i have to reload the page to show the updated data in the drop down. If i reload the page, i am adding two times the data to the database. Please help me how to reload the page in a script.
thanks


Cure
User

Jun 15, 2000, 1:48 PM

Post #2 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

just use the reload meta tag
<head>
<meta HTTP-EQUIV="REFRESH" CONTENT="0">
</head>


Kanji
User / Moderator

Jun 15, 2000, 3:41 PM

Post #3 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

Or you could print "Status: 302 Moved\nLocation: $url\n\n"; instead of the usual print "Content-Type: ...; which should be more widely supported.


Cure
User

Jun 15, 2000, 4:41 PM

Post #4 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

datlaravi

you can use the function in the CGI module called redirect. for more information on the CGI.pm perldoc CGI

Example CGI::redirect($url) or print "$url\n\n";


Cure


Kanji
User / Moderator

Jun 15, 2000, 6:29 PM

Post #5 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

... which does the "Status: 302 Moved..." trick. No need to call CGI.pm unless you really need it. :-)


datlaravi
Deleted

Jun 16, 2000, 6:12 AM

Post #6 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

Hi,
Thanks to both of you for the reply. I tried using both. Still i am not able to refresh the page. I have a subroutine which prints the form. In that form i had add subroutine. After i call that subroutine, I tried printing it, but it didn't work.
I tried printing "status moved" and also
$url = "sai.cgi"
CGI::redirect($url);
didn't work. Please help me if i am doing wrong.


TheGame+
Deleted

Jun 16, 2000, 6:48 AM

Post #7 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

Try typing "sai.cgi" in your browser - what do you get ?
Now try typing "http://whatever.server.com/cgi-bin/sai.cgi" - what do you get now ?

Guess what - your $url variable is probably wrong Smile


datlaravi
Deleted

Jun 16, 2000, 7:12 AM

Post #8 of 8 (1067 views)
Re: How to refresh a page in a perl script [In reply to] Can't Post

Thanks to all of you who replied to this question.
It worked. I appreciate all your help

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives