Skip to main content
Inspiring
Oct 23, 2006 2:59 PM UTC
Question

OT: How can I manage a "Please Wait" message with this scenario?

I have a page which allows you to paste in a potentially large list of zip
codes.

When you submit this page, the list is de-duped, and then checked against a
table of ~22,000 zips for matches.

Where and how in this process could I bring up a "Please Wait" message while
the transaction is being completed?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



This topic is closed to new replies. Start a new post to keep the conversation going.

17 replies

Inspiring
Oct 23, 2006 4:55 PM UTC
LOL - OK, see, I was hoping to avoid breaking it into separate pages like
that, but that way looks like it'll work....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns9865820E1614AmakowiecatnycapdotrE@216.104.212.96...
> On 23 Oct 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:
>
>> So - I'm not so sure I see an opportunity to do something while that
>> is going on....
>
> Input page -> processing page -> finished page
>
> On processing page, before you hit the code which does the actual
> processing:
>
> <h1 class="Pablo">Hold tight, you hopeless git!</h1>
>
> You could even put in a pointless counter.
>
> At the end of the code which does the processing, throw anything so
> that it completes the page. I'm thinking along these lines:
>
> <?php
> $output = "<noscript>\n";
> $output .= "<a href='finishedPage.php'>Processing done; see
> results</a>\n";
> $output .= "</noscript>\n";
> echo $output;
> ?>
>
> And do a redirect onload:
>
> <body onload="window.location='finishedPage.php'">
>
> Untested; use at your own risk.
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/email.php


Translate
Inspiring
Oct 23, 2006 4:47 PM UTC
On 23 Oct 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:

> So - I'm not so sure I see an opportunity to do something while that
> is going on....

Input page -> processing page -> finished page

On processing page, before you hit the code which does the actual processing:

<h1 class="Pablo">Hold tight, you hopeless git!</h1>

You could even put in a pointless counter.

At the end of the code which does the processing, throw anything so
that it completes the page. I'm thinking along these lines:

<?php
$output = "<noscript>\n";
$output .= "<a href='finishedPage.php'>Processing done; see results</a>\n";
$output .= "</noscript>\n";
echo $output;
?>

And do a redirect onload:

<body onload="window.location='finishedPage.php'">

Untested; use at your own risk.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Translate
Inspiring
Oct 23, 2006 4:40 PM UTC
hmmm....looking....thinking.

interesting.



During the processing of the data it looks to me that you have the ability
to put something in. This will obviously mean, however, that your SQL
statement will have already been executed, so it won't address (B).

For testing, you could put a quick "waiting" function to first check and see
if you can catch any delays....

but how to get it if the variable has the *correct* info, not just 1/2 the
info? You would have to match numbers


do{
echo " please wait";
}while(number of overlaps+number of unique <= Total number of records ($i, I
think?))


let me think a bit further on this


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:ehineh$28a$1@forums.macromedia.com...
>I just don't see how that could work, honestly - the delay is in a) the
>processing of the input data, and b) the SQL processing (I believe) of this
>data against the master list.
>
> mysql_select_db($database_selectData, $selectData);
> $query_rsMaster = "SELECT * FROM tblmasterzip";
> $rsMaster = mysql_query($query_rsMaster, $selectData) or
> die(mysql_error());
> $row_rsMaster = mysql_fetch_assoc($rsMaster);
> $totalRows_rsMaster = mysql_num_rows($rsMaster);
>
> if (isset($_POST['Submit'])) {
> $inputstring=$_POST['upload'];
> if($inputstring=='') { $error=2;
> header("Location:
> s_upload-zips-failure.php?type=$error&record=$contactRecord");
> exit; }
> if(strpos($inputstring,',')) { $error=3;
> header("Location:
> s_upload-zips-failure.php?type=$error&record=$contactRecord");
> exit; }
> $zipArray=explode("\n",$inputstring);
> $i=0;
> foreach($zipArray as $key => $value) {
> $zipArray[$i]=substr($value,0,5);
> $i++;
> }
> $totalUpload=($i);
>
>
> if($inputstring!='') {
> // create master list
> $masterList=array();
> do {
> $masterList[] = $row_rsMaster['masterZip'];
>
> } while ($row_rsMaster = mysql_fetch_assoc($rsMaster));


>
> // create array of unique zips from $zipArray
> $clientUnique=array_unique($zipArray);
> $numUnique = count($clientUnique);
> $numDupes = $totalUpload - $numUnique;
>
> //create array of overlaps between master list and deduped upload
> $overlaps = array_intersect($masterList,$clientUnique);
> $numOverlaps = count($overlaps);
>
> //calculate percentage overlapping Master
> $percentOverlapMaster = count($overlaps)/count($masterList)*100;
>
> // round percentage to 1 decimal place and add percent sign
> $percentOverlapMaster = number_format($percentOverlapMaster,1)."%";
>
> //calculate percentage of upload that overlap
> $percentOverlapUpload = count($overlaps)/$numUnique*100;
>
> // round percentage to 1 decimal place and add percent sign
> $percentOverlapUpload = number_format($percentOverlapUpload,1)."%";
>
> So - I'm not so sure I see an opportunity to do something while that is
> going on....


Translate
Inspiring
Oct 23, 2006 3:34 PM UTC
I just don't see how that could work, honestly - the delay is in a) the
processing of the input data, and b) the SQL processing (I believe) of this
data against the master list.

mysql_select_db($database_selectData, $selectData);
$query_rsMaster = "SELECT * FROM tblmasterzip";
$rsMaster = mysql_query($query_rsMaster, $selectData) or die(mysql_error());
$row_rsMaster = mysql_fetch_assoc($rsMaster);
$totalRows_rsMaster = mysql_num_rows($rsMaster);

if (isset($_POST['Submit'])) {
$inputstring=$_POST['upload'];
if($inputstring=='') { $error=2;
header("Location:
s_upload-zips-failure.php?type=$error&record=$contactRecord");
exit; }
if(strpos($inputstring,',')) { $error=3;
header("Location:
s_upload-zips-failure.php?type=$error&record=$contactRecord");
exit; }
$zipArray=explode("\n",$inputstring);
$i=0;
foreach($zipArray as $key => $value) {
$zipArray[$i]=substr($value,0,5);
$i++;
}
$totalUpload=($i);


if($inputstring!='') {
// create master list
$masterList=array();
do {
$masterList[] = $row_rsMaster['masterZip'];

} while ($row_rsMaster = mysql_fetch_assoc($rsMaster));

// create array of unique zips from $zipArray
$clientUnique=array_unique($zipArray);
$numUnique = count($clientUnique);
$numDupes = $totalUpload - $numUnique;

//create array of overlaps between master list and deduped upload
$overlaps = array_intersect($masterList,$clientUnique);
$numOverlaps = count($overlaps);

//calculate percentage overlapping Master
$percentOverlapMaster = count($overlaps)/count($masterList)*100;

// round percentage to 1 decimal place and add percent sign
$percentOverlapMaster = number_format($percentOverlapMaster,1)."%";

//calculate percentage of upload that overlap
$percentOverlapUpload = count($overlaps)/$numUnique*100;

// round percentage to 1 decimal place and add percent sign
$percentOverlapUpload = number_format($percentOverlapUpload,1)."%";

So - I'm not so sure I see an opportunity to do something while that is
going on....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"crash" <crash@bcdcdigital.com> wrote in message
news:ehims2$1gq$1@forums.macromedia.com...
> do while
> show "Please Wait graphic
> until $ListVar !empty?
>
>
>
> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:ehilbo$srm$1@forums.macromedia.com...
>>I have a page which allows you to paste in a potentially large list of zip
>>codes.
>>
>> When you submit this page, the list is de-duped, and then checked against
>> a table of ~22,000 zips for matches.
>>
>> Where and how in this process could I bring up a "Please Wait" message
>> while the transaction is being completed?
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do so!)
>> ==================
>> http://www.dreamweavermx-templates.com - Template Triage!
>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>> ==================
>>
>>
>>
>
>


Translate
Inspiring
Oct 23, 2006 3:24 PM UTC
do while
show "Please Wait graphic
until $ListVar !empty?



"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:ehilbo$srm$1@forums.macromedia.com...
>I have a page which allows you to paste in a potentially large list of zip
>codes.
>
> When you submit this page, the list is de-duped, and then checked against
> a table of ~22,000 zips for matches.
>
> Where and how in this process could I bring up a "Please Wait" message
> while the transaction is being completed?
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
>
>


Translate