DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: "please wait" page

  1. #1
    Join Date
    Mar 2009

    "please wait" page

    Okay, I've looked at a few tutorials, yet I can't seem to get this right. I have some experience with other programming languages, but little with Javascript.

    I currently have a PHP page that takes a little while to load, and I want to have it display a "please wait" page while it processes. Basically, I want the flow to be as follows:

    User input page -> intermediate "please wait" page -> PHP results page

    However, I can't seem to get it to work. My main problem is that I don't know how to pass the posted variables through the intermediate page. I tried making the "please wait" page PHP and assigned the post variables to session variables, but the final page didn't seem to recognize them. Thoughts?

  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Welcome to DevX
    Quote Originally Posted by djslothario View Post
    Okay, I've looked at a few tutorials, yet I can't seem to get this right.
    What have you tried that doesn't seem to be working?

  3. #3
    Join Date
    Mar 2009
    Okay, I decided to change it a little.

    so the structure, for reference, is indexTst.html -> one of those floating boxes made with CSS -> processTst2.php

    IndexTst.html code:
    HTML Code:
    <form action="processTst2.php" method="POST" name="queryform">
    <input type="submit" onClick="getContent()">
    <div id="wait" style="background-color:white;position:absolute;top:240px;left:360px;width:70px;height:50px;visibility:hidden;border: 1px solid black;padding:20px;">
    	<img src="images/wait.gif" style="position:relative;top:0px;left:25px"><br /><br />Please wait...</div>
    Here's my javascript code:
    var request;
    function getHTTPObject() 
        var xhr = false;
        if (window.XMLHttpRequest) 
            xhr = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
                    xhr = false;
        return xhr;
    function getContent()
        request = getHTTPObject();
        request.onreadystatechange = sendData;"POST", "processTst2.php", true);
    function sendData()
    	if (http.readyState == 4) {
    		document.getElementById('wait').style.visibility = "hidden";
    		alert('The server script has now completed');
    		window.location = "processTst2.php";
    	} else {
    		document.getElementById('wait').style.visibility = "visible";
    The odd thing is that it does redirect and process2.php works fine. Thoughts?
    Last edited by djslothario; 03-20-2009 at 01:39 PM.

Similar Threads

  1. Reload already opened asp page!
    By vermankita in forum Web
    Replies: 0
    Last Post: 02-14-2009, 12:52 AM
  2. Change page title on AJAX site...JS?
    By raindance in forum AJAX
    Replies: 11
    Last Post: 12-17-2008, 07:27 PM
  3. Replies: 0
    Last Post: 08-30-2007, 03:51 PM
  4. Loading Page Variables
    By hoyaabanks in forum ASP.NET
    Replies: 0
    Last Post: 02-26-2007, 04:46 PM
  5. Replies: 4
    Last Post: 06-24-2005, 01:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center