
21/12/2011, 06:42
|
| | Fecha de Ingreso: marzo-2005
Mensajes: 276
Antigüedad: 20 años Puntos: 0 | |
Respuesta: Problema cookies OK! Entiendo y funcionó!!!
Os dejo cómo quedo el código por si a alguien le sirve de ayuda:
<?
function miCookie(){
//setcookie("miCookie", "el valor aleatorio ".rand(), time()+3600);
$_COOKIE['miCookie'] = "el valor aleatorio ".rand();
}
if ($_REQUEST["votar"]==1){
miCookie();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<? print_r($_COOKIE); ?>
<div id="encuestaHome">
PROBANDO COOKIES
<a href="index.php?votar=1">votar</a>
</div>
</body>
</html> |