Ver Mensaje Individual
  #12 (permalink)  
Antiguo 06/06/2011, 18:44
Avatar de memoadian
memoadian
Colaborador
 
Fecha de Ingreso: junio-2009
Ubicación: <?php echo 'México'?>
Mensajes: 3.696
Antigüedad: 15 años, 7 meses
Puntos: 641
Respuesta: error Invalid argument supplied

Cita:
Iniciado por parserxml Ver Mensaje
lee la linea que comenté

Código PHP:
 ){//<<--- ¿por que quitas esta parte? nada tiene que ver con el foreach

    
    
foreach($_POST['repro'] as $repro){
        
$var $var.$repro.";";
    }
    foreach(
$_POST['repro2'] as $nombre){
        
$var $var.$nombre.";";
    } 
deberia ser así

Código PHP:
Ver original
  1. <?php
  2. include('../config.php');
  3. if($_SESSION["logeado"] != "SI"){
  4. header ("Location: ../index.php");
  5. }
  6. if($_SESSION["rango"] != "admin"){
  7. header ("Location: ../index.php");
  8. }
  9. $msg = "";
  10. $id = $_GET["id"];
  11. if($_POST['enviar']){
  12. if(!empty($_POST['nombre']) and !empty($_POST['imagen']) and !empty($_POST['genero'])  and !empty($_POST['id_anime']) and !empty($_POST['descargar']) and !empty($_POST['tamaño']) and !empty($_POST['embed']) and !empty($_POST['descripccion'])){
  13.  
  14.     $sql = "INSERT INTO pelis (imagen,nombre,descripccion,genero) VALUES ('".$_POST['imagen']."','".$_POST['nombre']."','".$_POST['descripccion']."','".$_POST['genero']."')";
  15.     $sql2 = "INSERT INTO pelis2 (id_peli,embed,tamaño,descargar) VALUES ('".$_POST['id_anime']."','".$_POST['embed']."','".$_POST['tamaño']."','".$_POST['descargar']."')";
  16.    
  17.     mysql_query($sql,$conex);
  18.     mysql_query($sql2,$conex);
  19.     $msg = "Se agrego correctamente la pelicula";
  20. } else { $msg = "Falta llenar algun dato"; }
  21. }
  22. ?>