Solved

how to display please wait message and redraw

Posted on 2000-04-17
12
284 Views
Last Modified: 2011-09-20
This may fall under html but I'll ask it here anyway.  I have a rather large search taking place through php that takes about 20 seconds to complete.  What would be great is if there is a way for our banners to be displayed with a message below them saying this will take a few moments and then to have that message replaced by the results of the search.  Can this be done?  If so how?  It doesn't have to code, just show me the path with the bread crums :-)

Thanks.
0
Comment
Question by:fordste
  • 4
  • 3
  • 2
  • +2
12 Comments
 
LVL 8

Expert Comment

by:us111
ID: 2723919
hmm I think you can't do that with PHP.
Javascript(dhtml) is only the good solution for your problem.
I may wrong but  php is a server-side language, it returns
to your browser only "static page".
0
 
LVL 2

Expert Comment

by:freshmeat
ID: 2724968
yes, i think it can be done by PHP
but i don't know how to either
so, let's wait for experts!
:)
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2725114
I think the problem with this is that you need PHP to be able to determine when your search has finished.

Here's an idea ...

Create two php files

One retreives the web search page from the server and then sets an marker file using a unique session id.

The other displays a message and waits for the existance of the marker file for a specified time limit and then redirects the use to this page...

Expanding on this...

Page One...

1. Gets the parameters from the search
2. Creates a Unique ID
3. Starts the search using the Paramters using the file('http://server/search?SearchString') function
4. Gets all of the data from file() and writes it to a <session>.html file
5. Redirects the user to the second page
6. When all the data has been read from the file() Function and output
creates <session>.finished file

Page two

1. Checks for the existance of the <session>.finshed file
2. If it exists then redirect the use to it
3. If it doesn't exist refreshes the current page after 2 seconds
4. If a specified number of refreshes has been reached and the .finished file doesn't exist then display a time-out message.

For redirection you can use the function

print ("<HEAD><META HTTP-EQUIV=Refresh CONTENT=2;URL=/Server/page.php3?$SessionID></HEAD>");

Might work ??? You will need to run something to clean up the temp files though... There might be a prettier way though ??




0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Expert Comment

by:mrvithan
ID: 2725158
I think Samon give you a idea. don't he ?
But i think you better do this by using Javascript 'cause it's quite easier. You may do it as same as window style. The reason is as same as us111 'cause PHP is a sever-side script.

0
 
LVL 8

Expert Comment

by:us111
ID: 2726158
Simon's comment could be a solution but more easier with javascript.
hmm, what's happened when you leave your page and redirect to page two ?
Is the session file already written ? hmm, if you run a script in background, yes otherwise I don't think so.

What's happened if my connection is really bad ??

As for me, the best solution is Javascript
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2726490
I agree with everyone here, javascript is a much better solution for this ..  Something like have two <div> one visible with the message and the other that contains all of the data that becomes visible only after  the document is finshed loading ( document.all)...

But this is the PHP section so I at least thought I would give a PHP solution a go .... You may have noticed I only said it might work !!!

0
 
LVL 8

Expert Comment

by:us111
ID: 2726619
:)
0
 

Author Comment

by:fordste
ID: 2727188
Thanks for all your comments.  From what I am reading I guess I need to add javascript to my resume by learning it.  

Simon Henry if you could just give an answer, I would like to give you some points because you did come up with an idea that would work but it might be easier for me to learn javascript then to use your idea.

I am going to be posting this question under javascript since this needs to have been done last week and my first day on the job was yesterday :-/
0
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 200 total points
ID: 2728599
Heres my answer as requested....

If your looking to learn javascript quickly check out http://developer.netscape.com under the javascript manuals.. It is an extremely good site with heaps of useful examples...

I use http://developer.netscape.com/docs/manuals/js/client/jsref/ on a daily basis as it contains the entire DOM ( Document object Model ).

Thanks Again

Simon Hendry
0
 

Expert Comment

by:mrvithan
ID: 2729046
But if you would like to use IE. or crosss brower you better go here http://www.dansteinman.com/dynduo/

and http://www.javascript.com
 
hope my comment would help you some
0
 
LVL 8

Expert Comment

by:us111
ID: 2729713
http://www.brainjar.com

In my opinion, Dynamic Duo (dansteinman.com) is the most powerful library for DHTML.
0
 

Author Comment

by:fordste
ID: 2730594
Thanks for the help and the sites.  I've got some reading to do.

Stephen
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question