Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/05/2010, 01:33
PsyRocker
 
Fecha de Ingreso: febrero-2010
Mensajes: 7
Antigüedad: 14 años, 2 meses
Puntos: 0
[Ayuda] Problemas con Foreach

Hola que tal, la verdad es que llevo mas de 2 horas tratando de buscar por todos lados soy principiante en php pero esto me tiene loco con los checkbox en php

este es mi codigo...

<?php
foreach($_POST['opcion'] as $opcion){
print $opcion;
}
?>


<!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=utf-8" />
<title>Documento sin título</title>
</head>
<body>
<input type=checkbox name="opcion[]" value="opcion1">
<input type=checkbox name="opcion[]" value="opcion2">
<input type=checkbox name="opcion[]" value="opcion3">
</body>
</html>



parace que todo esta correcto pero al correrlo en mi navegador me aparece esto!!


Warning: Invalid argument supplied for foreach() in C:\AppServ\www\crud\otro.php on line 2

si alguien me podria echar una manita se lo agradeceria mucho
Saludos colegas!