note 59729 added to ref.session

From: Date: Wed, 14 Dec 2005 13:09:34 +0000
Subject: note 59729 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-100127@lists.php.net to get a copy of this message
I forgot you'll need another file. You must call it 'funciones.php'... <?php function aleatoriza_texto($cadena1) { for($x=0;$x<(strlen($cadena1)-1);$x++){ $p=rand(0,(strlen($cadena1)-1)); $v=$cadena1{$x}; $cadena1{$x}=$cadena1{$p}; $cadena1{$p}=$v; } return $cadena1; } function aleatoriza_texto_conservando_inicio_y_fin($cadena1) { for($x=1;$x<(strlen($cadena1)-2);$x++) { $p=rand(1,(strlen($cadena1)-2)); $v=$cadena1{$x}; $cadena1{$x}=$cadena1{$p}; $cadena1{$p}=$v; } return $cadena1; } function cifra_mensaje($cadena1) { $palabras = split(" ", $cadena1); for ($i=0;$i<(count($palabras));$i++) { $resultado=aleatoriza_texto_conservando_inicio_y_fin($palabras[$i]); $resultado_final .= " " . $resultado; } return $resultado_final; } function abre_web($titulo) { $salida=<<<pre <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sp" lang="sp"> <head> <title>$titulo</title> </head> <body> pre; return $salida; } function cierra_web() { $salida=<<<pre </body> </html> pre; return $salida; } function formulario_principal() { echo abre_web(Entrada); $salida=<<<pre <form action ="ahorcado.php" method = "post"> <p>Palabra a adivinar</p> <input type ="text" name ="palabra"/> <br> <p>Numero de intentos</p> <input type ="text" name ="max_intentos"/> <br> <input type = "submit" value= "JUGAR"/> <input type = "reset" value= "borrar"/> </form> pre; echo $salida; echo cierra_web(); } ?> ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+59729 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59729&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+59729&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#100127) next »