Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/08/2002, 09:39
vito_gris
 
Fecha de Ingreso: agosto-2002
Mensajes: 301
Antigüedad: 21 años, 8 meses
Puntos: 2
Re: Hacer enquestas con php sin BD

$file = join('', $file_array);
$fp = fopen("$RESULT_FILE_NAME", "w"); //or error("Can not write \$RESULT_FILE_NAME");
flock($fp, 1);
fputs($fp, $file);
flock($fp, 3);
fclose($fp);
echo "";
}

// En: Display result
// Fr: Affiche le resultat
while (list($key, $val) = each($file_array)) {
$total += $val;
}

echo "";
echo "<TABLE CELLSPACING=2 CELLPADDING=0 BORDER=1>";
echo "<tr><th>Respuesta</th><th>Resultado</th></tr>";

while (list($key, $val) = each($ANSWER)) {
$percent = $file_array[$key] * 100 / $total;
$percent_int = floor($percent);
$percent_float = number_format($percent, 1);
$tp += $percent_float;
echo "<tr><td> $ANSWER[$key] </td><td><img height=9 src=\"$IMG_DIR_URL/vote_left.gif\"><img height=9 width=\"$percent_int\" src=\"$IMG_DIR_URL/vote_middle.gif\"><img height=9 src=\"$IMG_DIR_URL/vote_right.gif\"> $percent_float % </td></tr>";
}

echo "</TABLE><br>";
}

?>