abrir fichero
Publicado por fgf (16 intervenciones) el 11/11/2002 10:15:36
Estoy empezando con php y me ha surgido un problema a la hora trabajar usando codigo php con html. Ruego alguien me pueda ayudar. Tengo el siguiente código y siempre me ejecuta la función crear_fichero(), sin esperar respuesta por mi parte:
<html>
<head>
<title>Untitled</title>
function crear_fichero() {
$fichero = fopen
("fichero_prueba.txt","a");
fclose ($fichero);
}
?>
</head>
<body>
<table>
<tr>
<td>Si quieres crear un fichero, pulsa</td>
<td onclick="<?crear_fichero()?>">aqui</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title>Untitled</title>
function crear_fichero() {
$fichero = fopen
("fichero_prueba.txt","a");
fclose ($fichero);
}
?>
</head>
<body>
<table>
<tr>
<td>Si quieres crear un fichero, pulsa</td>
<td onclick="<?crear_fichero()?>">aqui</td>
</tr>
</table>
</body>
</html>
Valora esta pregunta


0