How to output half a page at a time?


I have a situation where I want to output html to the client browser for display ("Please wait...") while I am validating the credit card data...this can take up to 60 secs...when the credit card is validated, then I want to display "Your card is validated"

What is the best way to do this?

Keith Kwiatek
Who is Participating?
MaDdUCKConnect With a Mentor Commented:
with cgi, you would name the cgi file nph-cgi.exe or just nph-cgi (nph - non-parsed header). then, you need to output all headers with this cgi:

HTTP/1.0 200 OK
Content-type: text/html

then your text.

after the please wait, flush stdout and it should display. finally, simply continue writing to stdout and flushing it to display records.
Michel PlungjanIT ExpertCommented:
See answer in JavaScript forum
What're the tools,scripts you're using?
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

What're the tools,scripts you're using?
Try the simple way:
No java No javascript just the simple way!
<!-- 60 = 60 seconds pause time before loading the second page-->
  <META HTTP-EQUIV="REFRESH" CONTENT="60; URL= home page/my second">
  <TITLE>pause for 60 seconds and load sound! </TITLE>
<BODY BGCOLOR="#ffffff">




<P><CENTER><FONT SIZE="+2">Welcome To</FONT></CENTER></P>

<P><CENTER><I><FONT SIZE="+3">my site....</FONT></I></CENTER></P>

<P><CENTER><FONT SIZE="+2">Please stand By - Page is Loading!</FONT></CENTER></P>

<P><CENTER><FONT SIZE="+2"></FONT>&nbsp;</CENTER></P>

<P><CENTER><I><FONT SIZE="+2">Our Pages are best viewed at 800
x 600</FONT></I></CENTER></P>

<P><CENTER><I><FONT SIZE="+2">Using <A HREF="">Netscape</A>!</FONT></I></CENTER></P>

<P><CENTER><I><FONT SIZE="+2">Some pages contain audio!</FONT></I></CENTER></P>

<P><EMBED SRC="midi/my audio.mid" AUTOSTART="true" HIDDEN="TRUE"


Try it and see if it works for you.

I helped to build the site  that using this method.

You can add music, Commercial wav files and so...

You can place cascade of META HTTP-EQUIV="REFRESH" CONTENT="60;... why not after 15 30 45 seconds to let your user know progress time ...

Again No JAVA No Javascript...

any more help email to

Good luck.
edwardk091997Author Commented:

I had been doing what you suggest, but it seems to only work some of the time....

Sometimes it will print the first half of the page, and then, a few moments later, it will print the second half of the page (this is what I want)....BUT, at other times, the browser will wait till it has the whole page before it displays it out....

Any other ideas/suggestions?


What could be going on here?
give me your code...i need to see it to tell you what's up.
edwardk091997Author Commented:
I have been testing with a simple perl script...sometimes it works, sometimes it doesn't...

require ";

print"Content-Type: text/html\n\n";
print"<HTML> Start the output with this .......<P>";

for ($i=0;$i<5;$i++)

print"<P>...finish the page with this!<P></html>";

can you give me till the weekend. I have spotted your error and I would like to answer this question, but I am very busy right now. basically you are not outputting all headers required for nph scripts and you assume the server will do it for you. sometimes this will work, but most of the time it will not. I will get to this on the weekend, promise!

if you really urgently need this soon then I guess I could be persuaded, but I would really prefer to wait a little.
edwardk091997Author Commented:
It is important to me....but I can wait...Thank you so much for your help!

Okay, to quickly help you: you should do the following:

require ";

my ok_response = "200 OK";
print $ENV("SERVER_PROTOCOL")." ".ok_response\r\n";
print "Expires: 0\r\n";
print "Content-Type: text/html\r\n\r\n";

// the rest here


call your script "" and see if this works (the nph- is important!)


my Perl may be a bit rusty...$ENV(var) should retrieve the contents of the environment variable #var#.
edwardk091997Author Commented:
Thanks for all your help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.