Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    148
    Thanks
    1
    Thanked 0 Times in 0 Posts

    possible to pass and display the data before some of data in processing?

    as title upper, isnt possible to display the data before some of the data still in processing in server?

    for example,
    i had one page that peform the calculation with more that ten calculation of huge numeric of data and compare between each other. when the user insert all the data and pass to the server, isnt possible we display other data to the user and after the compare process had finish just display the result to the user?
    possible to do that? other had other more efficient way to do that?

    thanks.
    Last edited by CstAn; 12-31-2005 at 01:45 PM.

  • #2
    Regular Coder Element's Avatar
    Join Date
    Jul 2004
    Location
    Lynnwood, Washington, US
    Posts
    855
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Quote Originally Posted by CstAn
    as title upper, isnt possible to display the data before some of the data still in processing in server?

    for example,
    i had one page that peform the calculation with more that ten calculation of huge numeric of data and compare between each other. when the user insert all the data and pass to the server, isnt possible we display other data to the user and after the compare process had finish just display the result to the user?
    possible to do that? other had other more efficient way to do that?

    thanks.
    Your use of english threw me off a bit, but I think I have an idea of what you mean... It is possible... if your using $_POST you can output any of the data at any given time, basically.

    For example:

    PHP Code:
    <?php

    if (isset($_POST)) {

      echo 
    "Your submitted data:<br /><br />\n\n";

      foreach(
    $_POST as $key => $data) {
        echo 
    "<b>" $key "</b>: " $data "<br />\n";
      }
       
       
       
    $this = array( $_POST['first_numbers'], $_POST['second_numbers'] );
       
    $operator $_POST['operator'];
       
    $valid_operators = array( "*""/""+""-" );

       if(isset(
    $this[0]) && isset($this[1])) {
         if(
    in_array($operator$valid_operators)) {
           if(
    $operator == "*") {
             
    $result $this[0] * $this[1];
             echo 
    "<p><i>" $this[0] . " x " $this[1] . " =</i> <b>" $result "</b></p>";
           } elseif(
    $operator == "+") {
             
    $result $this[0] + $this[1];
             echo 
    "<p><i>" $this[0] . " + " $this[1] . " =</i> <b>" $result "</b></p>";
           } elseif(
    $operator == "-") {
             
    $result $this[0] - $this[1];
             echo 
    "<p><i>" $this[0] . " - " $this[1] . " =</i> <b>" $result "</b></p>";
           } elseif(
    $operator =="/") {
             
    $result $this[0] / $this[1];
             echo 
    "<p><i>" $this[0] . " / " $this[1] . " =</i> <b>" $result "</b></p>";
           } else {
             
    $result "A error has accured!";
           }
         } else {
           die(
    "Invalid operator!");
         }
       } else {
         die(
    "All form fields must be filled out correction, each text box must be filled with a numeric combination!");
       }
    } else {

      
    // ... Do the form here.

    }

    ?>
    Thats just an example, but as you can see the users data was outputted raw so the user knows the problem they entered is correct. (Nevermind the simplicity of the math engine, its just for the example, was bored and decided to write more, is all.)
    Last edited by Element; 01-01-2006 at 02:35 AM.

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    148
    Thanks
    1
    Thanked 0 Times in 0 Posts
    sorry for the broken english that i had write. Actually, I not very expert in write in english so just will use that so bad language.

    Element, the code that u post it not the solution for me. Anywhere thanks.

    Actually what i want to ask is some thing like when start up the window rite, it will show out the loading messages that show out it was in loading.
    isnt possible to show out the loading messages and at the sanme time the server still in process some other data and pass back when the server had finish process.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •