...

View Full Version : possible to pass and display the data before some of data in processing?



CstAn
12-31-2005, 01:35 PM
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.

Element
01-01-2006, 02:30 AM
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

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.)

CstAn
01-01-2006, 12:50 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum