Hay muchos fallistos , desde el formulario ,hasta el codigo php
Aqui te pongo todo , comparalo .
Código HTML:
<html>
<head>
<title>Problema</title>
</head>
<body>
<form action="pagina2.php" method="post">
Su nombre:
<input type="text" name="nombre">
<br>
Su direcion:
<input type="text" name="direccion">
<br>
Cuantas pizzas:
<input type="text" name="pizza">
<br>
Queso
<input type="checkbox" name="queso">
<br>
Chorizo
<input type="checkbox" name="chorizo">
<br>
Tomate
<input type="checkbox" name="tomate">
<br>
<input type="submit" name="enviar">
</form>
</body>
</html>
Código PHP:
$ar=fopen("datos.txt","a") or die("su peticion a fallado");
fputs($ar,$_REQUEST['nombre']);
fputs($ar,"\n");
fputs($ar,$_REQUEST['direccion']);
fputs($ar,"\n");
fputs($ar,$_REQUEST['pizza']);
fputs($ar,"\n");
if (isset($_REQUEST['queso']))
{
fputs($ar,"con queso");
fputs($ar,"\n");
}
if (isset($_REQUEST['chorizo'])) ## No estavas cerrando la funcion.
{
fputs($ar,"con chorizo");
fputs($ar,"\n");
}
if (isset($_REQUEST['tomate']))
{
fputs($ar,"con tomate");
fputs($ar,"\n");
}
fclose($ar);