este es el archivo que he creado
Código PHP:
<?php
$usuario = $_COOKIE['loggedin'];
if (!isset($_COOKIE['loggedin'])) die("<center><img src='images/error.png'><br><div id='miclase'>No te has identificado, <a href=index.html>click acá</a> para iniciar sesión.</center>");
include ("config.php");
mysql_connect($server, $db_user, $db_pass) or die (mysql_error());
$result = mysql_db_query($database, "select * from $table WHERE usuario = '$usuario'") or die (mysql_error());
while ($qry = mysql_fetch_array($result)) {
echo "Usuario: <input type='text' name='matricula' size='8' readonly value='$usuario'> ";
echo "Fecha ";
$fecha = date('d/m/y');
echo $fecha;
echo "<br><br>";
$conexion = mysql_connect("localhost", "root", "ene2012");
mysql_select_db("usuarios", $conexion);
$queEmp = "SELECT * FROM notas_cues";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
if ($totEmp> 0) {
while ($rowEmp = mysql_fetch_assoc($resEmp)) {
$not = $rowEmp['nota'];
$user = $rowEmp['usuario'];
$fech = $rowEmp['fecha'];
if ($user == $usuario && $fech == $fecha){
echo "Ya Te Evaluaste Hoy tu nota es $not <br><br>";
echo "<a href='form.php'>Volver</a>";
}
else{
$conexion = mysql_connect("localhost", "root", "ene2012");
mysql_select_db("usuarios", $conexion);
$queEmp = "SELECT * FROM cuestionario";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
echo "<form action='resultado.php' method='post' name='formulario'>";
echo "<table>";
if ($totEmp> 0) {
while ($rowEmp = mysql_fetch_assoc($resEmp)) {
$corre1 = $rowEmp['corre1'];
$corre2 = $rowEmp['corre2'];
$corre3 = $rowEmp['corre3'];
$corre4 = $rowEmp['corre4'];
echo "<strong>".$rowEmp['pregunta1']."</strong><br>";
echo "<tr><td><input type='radio' name='Res1' value='1'>";
echo "".$rowEmp['1res1']."<br>";
echo "<input type='radio' name='Res1' value='2'>";
echo "".$rowEmp['1res2']."<br>";
echo "<input type='radio' name='Res1' value='3'>";
echo "".$rowEmp['1res3']."<br>";
echo "<input type='radio' name='Res1' value='4'>";
echo "".$rowEmp['1res4']."<br></td></tr>";
echo "</table><br>";
echo "<table>";
echo "<strong>".$rowEmp['pregunta2']."</strong><br>";
echo "<tr><td><input type='radio' name='Res2' value='1'>";
echo "".$rowEmp['2res1']."<br>";
echo "<input type='radio' name='Res2' value='2'>";
echo "".$rowEmp['2res2']."<br>";
echo "<input type='radio' name='Res2' value='3'>";
echo "".$rowEmp['2res3']."<br>";
echo "<input type='radio' name='Res2' value='4'>";
echo "".$rowEmp['2res4']."<br></td></tr>";
echo "</table><br>";
echo "<br>";
echo "<table>";
echo "<strong>".$rowEmp['pregunta3']."</strong><br>";
echo "<tr><td><input type='radio' name='Res3' value='1'>";
echo "".$rowEmp['3res1']."<br>";
echo "<input type='radio' name='Res3' value='2'>";
echo "".$rowEmp['3res2']."<br>";
echo "<input type='radio' name='Res3' value='3'>";
echo "".$rowEmp['3res3']."<br>";
echo "<input type='radio' name='Res3' value='4'>";
echo "".$rowEmp['3res4']."<br></td></tr>";
echo "</table><br>";
}
}
echo "<input type='image' src='images/nota.png' />";
echo "</form>";
}
}
}
}
?>