Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > CGI: want no response from server

Reply
Thread Tools

CGI: want no response from server

 
 
Richard Trahan
Guest
Posts: n/a
 
      01-18-2004
I want to do something simple: nothing.

I have a form. When the user clicks Submit, I want the script to be
invoked in the usual manner, but I want no change at all in the client
page (the script does some background task on the server). I know I can
redirect to the referer, but that causes a scroll to top, which is
annoying for a large page. Even if I coded "#" links all over the
place to avoid the scroll, there would still be a long wait for
users with slow modems.

If I don't write anything to STDOUT from the script, I get error
messages from the server. I'm not sure what's happening here.
Can someone educate me?

 
Reply With Quote
 
 
 
 
gnari
Guest
Posts: n/a
 
      01-18-2004
"Richard Trahan" <(E-Mail Removed)> wrote in message
news:jatOb.119013$(E-Mail Removed) .net...
> I want to do something simple: nothing.
>
> I have a form. When the user clicks Submit, I want the script to be
> invoked in the usual manner, but I want no change at all in the client
> page (the script does some background task on the server). I know I can
> redirect to the referer, but that causes a scroll to top, which is
> annoying for a large page. Even if I coded "#" links all over the
> place to avoid the scroll, there would still be a long wait for
> users with slow modems.
>
> If I don't write anything to STDOUT from the script, I get error
> messages from the server. I'm not sure what's happening here.
> Can someone educate me?
>


the www or cgi groups are the correct place for this kind of
questions.

I do not have your answer, but if the referer page is also dynamic,
you might want to try to play with cache-control, date and
other HTTP headers, to try to convince the browser not to
reload.

gnari



 
Reply With Quote
 
 
 
 
Alan J. Flavell
Guest
Posts: n/a
 
      01-18-2004
On Sun, 18 Jan 2004, Richard Trahan wrote:

> I want to do something simple: nothing.


Not quite as simple as it looks; at least, it took browser
implementers a considerable time to get it right per the
specification, but AFAIK they're OK now.

> I have a form. When the user clicks Submit, I want the script to be
> invoked in the usual manner, but I want no change at all in the client
> page (the script does some background task on the server).


Not a Perl issue, and you ought to raise this kind of question on
a group where WWW CGI questions are on-topic, just as it hints in
perlfaq9. But in brief the answer is Status: 204 No response

> If I don't write anything to STDOUT from the script, I get error
> messages from the server.


Correct. All CGI scripts must return some kind of appropriate
response to STDOUT, or else the server will return an error report to
the client (typically "premature end of script headers").

> I'm not sure what's happening here.


perlfaq9 has pointers to the CGI specification, tutorials, and an
appropriate Usenet group. HTH.
 
Reply With Quote
 
Tore Aursand
Guest
Posts: n/a
 
      01-18-2004
On Sun, 18 Jan 2004 10:25:19 +0000, Richard Trahan wrote:
> I want to do something simple: nothing.
> [...]


In that case, it has _nothing_ to do with Perl.


--
Tore Aursand <(E-Mail Removed)>
"First, God created idiots. That was just for practice. Then He created
school boards." -- Mark Twain
 
Reply With Quote
 
David K. Wall
Guest
Posts: n/a
 
      01-18-2004
Tore Aursand <(E-Mail Removed)> wrote:

> On Sun, 18 Jan 2004 10:25:19 +0000, Richard Trahan wrote:
>> I want to do something simple: nothing.
>> [...]

>
> In that case, it has _nothing_ to do with Perl.


But NaDa may be just the tool for it:

http://www.bernardbelanger.com/computing/NaDa/

 
Reply With Quote
 
Arvin Portlock
Guest
Posts: n/a
 
      01-19-2004
> But in brief the answer is Status: 204 No response


A good answer. Another technique people use is an invisible frame.
Your HTML document will be a frameset with your form in a frame
that takes up 100% of the screen. But your form will target its
output to a second, invisible 0% frame that people never see:

<form action="some_script.pl" target="my_secret_frame">

But this solution carries with it all the overhead and
problems of frames in general for little benefit.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frames and Response.Redirect / Response.Write - Refresh Charles A. Lackman ASP .Net 2 01-11-2006 11:44 PM
Response.CharSet Vs Response.ContentEncoding Vs responseEncoding property in web.Config Calvin Lai ASP .Net 6 12-31-2003 06:55 PM
Response.Write and Response.Redirect Sehboo ASP .Net 3 12-10-2003 03:43 PM
Response.Expires and Response.Cache Promenade ASP .Net 2 12-05-2003 06:41 PM
Response.Write and Response.Redirect Matthew Wieder ASP .Net 4 07-17-2003 05:33 PM



Advertisments