// do not wait until end of datatransfer to print out data
ob_implicit_flush();
include ('config.php');
// creating socket to connect to server
$fxsock = fsockopen($protocol."://".$server,$port,$errno,$errstr,10);
fputs($fxsock,$_GET[ReqSQL]);
//echo "4>" . $reqStr . "<<";
// reading data from buffer while there is data
$read = true;
while($read) {
// reading char by char
$data = fgets($fxsock,2);
$rdata .= $data;
// the char is # the transimition is completed
if ($data == "#") {
$read = false;
}
}
// remove the 1022, from data
$rdata = substr($rdata,5);
if (intval($rdata)==-1)
{
?>
exit ;
}
// split the received datas into rows (seperated by ;)
$row = split(";",$rdata);
// split the rows into fields (sepearted by ,)
$i=0;
while ($row[$i]) {
$field[$i] = split ("`",$row[$i]);
$i++;
}
fclose($fxsock);
if (true)
{
// now generating the html table
$i=0;
$step = false;
while ($field[$i][0]) {
if ($step == false) {
$color = "#F0F0F0";
$step = true;
} else {
$color = "#E1E1E1";
$step = false;
}
?>