Foros del Web » Programando para Internet » PHP »

problema

Estas en el tema de problema en el foro de PHP en Foros del Web. Hola, soy fernando de montevideo, uruguay. ando en busca de ayuda por el siguiente tema: mi problema es el siguiente : cuando van a crear ...
  #1 (permalink)  
Antiguo 12/03/2012, 16:10
 
Fecha de Ingreso: marzo-2011
Mensajes: 115
Antigüedad: 13 años, 1 mes
Puntos: 0
problema

Hola, soy fernando de montevideo, uruguay. ando en busca de ayuda por el siguiente tema:

mi problema es el siguiente : cuando van a crear anuncio en mi pagina y quieren crear algun anuncio en cualquiera de las cuatro secciones lo hace lo mas bien y las imagenes suben y luego se ven sin problema, pero el problema es el siguiente : una ves que el usuario sube sus fotos y publica su anuncio en por ejemplo crear vehiculos me pone lo siguiente : Warning: move_uploaded_file(image/PIC_0132.JPG) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/apaulaza/public_html/uy/crear_vehiculos.php on line 46

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpgGlueM' to 'image/PIC_0132.JPG' in /home/apaulaza/public_html/uy/crear_vehiculos.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /home/apaulaza/public_html/uy/Connections/hoysale.php:12) in /home/apaulaza/public_html/uy/crear_vehiculos.php on line 88

no me doy cuenta a que se debera?

el codigo que uso en esta pagina es el siguiente : linea 46 y 88

Código PHP:
    move_uploaded_file($_FILES['Imagen1']['tmp_name'], $ruta1); 
  
header(sprintf("Location: %s"$insertGoTo)); 

si me pueden ayudar muchas gracias!!!

Última edición por GatorV; 12/03/2012 a las 16:33
  #2 (permalink)  
Antiguo 12/03/2012, 16:13
 
Fecha de Ingreso: marzo-2011
Mensajes: 115
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: problema

parte php del codigo
Código PHP:
<?php require_once('Connections/hoysale.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
    
//Guardar imagen
    
if(is_uploaded_file($_FILES['Imagen']['tmp_name'])) { // verifica haya sido cargado el archivo
    
$ruta"imageness/".$_FILES['Imagen']['name'];
    
$ruta0"imagen/".$_FILES['Imagen0']['name'];
    
move_uploaded_file($_FILES['Imagen']['tmp_name'], $ruta);
    
move_uploaded_file($_FILES['Imagen0']['tmp_name'], $ruta0);
    
$ruta1"image/".$_FILES['Imagen1']['name'];
    
$ruta2"imag/".$_FILES['Imagen2']['name'];
    
move_uploaded_file($_FILES['Imagen1']['tmp_name'], $ruta1);
    
move_uploaded_file($_FILES['Imagen2']['tmp_name'], $ruta2);
    
$ruta3"ima/".$_FILES['Imagen3']['name'];
    
$ruta4"im/".$_FILES['Imagen4']['name'];
    
move_uploaded_file($_FILES['Imagen3']['tmp_name'], $ruta3);
    
move_uploaded_file($_FILES['Imagen4']['tmp_name'], $ruta4);
    }

  
$insertSQL sprintf("INSERT INTO formulario_vehiculos (valor, precios, Moneda, Titulo, Descripcion, Direccion, Codigo_Postal, email, telefono, celular, Imagen, Imagen0, Imagen1, Imagen2, Imagen3, Imagen4, usuario, categoria, Modelo, id_kilometros, ano_vehiculo, id_departamentos, web, tipo) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['valor'], "int"),
                       
GetSQLValueString($_POST['precio'], "text"),
                       
GetSQLValueString($_POST['moneda'], "text"),
                       
GetSQLValueString($_POST['titulo'], "text"),
                       
GetSQLValueString($_POST['descripcion'], "text"),
                       
GetSQLValueString($_POST['direccion'], "text"),
                       
GetSQLValueString($_POST['postal'], "text"),
                       
GetSQLValueString($_POST['email'], "text"),
                       
GetSQLValueString($_POST['telefono'], "text"),
                       
GetSQLValueString($_POST['celular'], "text"),
                       
GetSQLValueString($ruta"text"),
                       
GetSQLValueString($ruta0"text"),
                       
GetSQLValueString($ruta1"text"),
                       
GetSQLValueString($ruta2"text"),
                       
GetSQLValueString($ruta3"text"),
                       
GetSQLValueString($ruta4"text"),
                       
GetSQLValueString($_POST['usuario'], "text"),
                       
GetSQLValueString($_POST['categoria'], "int"),
                       
GetSQLValueString($_POST['modelo'], "int"),
                       
GetSQLValueString($_POST['kilometros'], "int"),
                       
GetSQLValueString($_POST['ano'], "int"),
                       
GetSQLValueString($_POST['departamento'], "int"),
                       
GetSQLValueString($_POST['web'], "text"),
                       
GetSQLValueString($_POST['tipo'], "int"));

  
mysql_select_db($database_hoysale$hoysale);
  
$Result1 mysql_query($insertSQL$hoysale) or die(mysql_error());

  
$insertGoTo "anuncio_creado.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}

mysql_select_db($database_hoysale$hoysale);
$query_ver_departamento "SELECT * FROM departamentos";
$ver_departamento mysql_query($query_ver_departamento$hoysale) or die(mysql_error());
$row_ver_departamento mysql_fetch_assoc($ver_departamento);
$totalRows_ver_departamento mysql_num_rows($ver_departamento);

mysql_select_db($database_hoysale$hoysale);
$query_ver_categorias "SELECT * FROM vehiculos";
$ver_categorias mysql_query($query_ver_categorias$hoysale) or die(mysql_error());
$row_ver_categorias mysql_fetch_assoc($ver_categorias);
$totalRows_ver_categorias mysql_num_rows($ver_categorias);

mysql_select_db($database_hoysale$hoysale);
$query_ver_modelos "SELECT * FROM modelo_vehiculo";
$ver_modelos mysql_query($query_ver_modelos$hoysale) or die(mysql_error());
$row_ver_modelos mysql_fetch_assoc($ver_modelos);
$totalRows_ver_modelos mysql_num_rows($ver_modelos);

mysql_select_db($database_hoysale$hoysale);
$query_ver_kilometros "SELECT * FROM kilometros_vehiculos";
$ver_kilometros mysql_query($query_ver_kilometros$hoysale) or die(mysql_error());
$row_ver_kilometros mysql_fetch_assoc($ver_kilometros);
$totalRows_ver_kilometros mysql_num_rows($ver_kilometros);

mysql_select_db($database_hoysale$hoysale);
$query_ver_tipo "SELECT * FROM buscoofresco";
$ver_tipo mysql_query($query_ver_tipo$hoysale) or die(mysql_error());
$row_ver_tipo mysql_fetch_assoc($ver_tipo);
$totalRows_ver_tipo mysql_num_rows($ver_tipo);

mysql_select_db($database_hoysale$hoysale);
$query_ver_ano "SELECT * FROM ano_vehiculos";
$ver_ano mysql_query($query_ver_ano$hoysale) or die(mysql_error());
$row_ver_ano mysql_fetch_assoc($ver_ano);
$totalRows_ver_ano mysql_num_rows($ver_ano);

mysql_select_db($database_hoysale$hoysale);
$query_ver_valor "SELECT * FROM valor_vehiculos";
$ver_valor mysql_query($query_ver_valor$hoysale) or die(mysql_error());
$row_ver_valor mysql_fetch_assoc($ver_valor);
$totalRows_ver_valor mysql_num_rows($ver_valor);
?>

Etiquetas: html, imagenes, usuarios
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:38.