Ver Mensaje Individual
  #9 (permalink)  
Antiguo 17/06/2008, 10:44
jonysi_d
 
Fecha de Ingreso: octubre-2007
Mensajes: 724
Antigüedad: 16 años, 6 meses
Puntos: 4
Respuesta: multipart/form-data y formulario junto, es possible ???

esto es lo que necesitas ???
disculpa mi ignirancia:

<?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"] == "form2")) {
$insertSQL = sprintf("INSERT INTO fotos (nombre, usuario, lugarfoto, descripcion, foto) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nombre'], "text"),
GetSQLValueString($_POST['usuario'], "text"),
GetSQLValueString($_POST['lugarfoto'], "text"),
GetSQLValueString($_POST['descripcion'], "text"),
GetSQLValueString($_POST['foto'], "text"));

mysql_select_db($database_jmisitio, $misitio);
$Result1 = mysql_query($insertSQL, $misitio) or die(mysql_error());

$insertGoTo = "enviar-fotos-paso2_personal_restringido.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>