Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/10/2011, 17:10
ofertasdiarias
 
Fecha de Ingreso: marzo-2011
Mensajes: 115
Antigüedad: 13 años, 1 mes
Puntos: 0
problema con formulario, por favor

HOLA ESTOY EN BUSCA DE SU AYUDA :

TENGO ESTE FORMULARIO PARA ENVIAR ARTICULOS A MI WEB ES PARA UN SITIO DE CLASIFICADOS QUE ESTOY HACIENDO MIREN ESTE ES EL SCRIPT

Código PHP:
<!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=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
#Layer1 {
    position:absolute;
    left:123px;
    top:33px;
    width:600px;
    height:600px;
    z-index:1;
}
-->
</style>
</head>

<body>
<div id="Layer1">
  <form action="<?php echo $editFormAction?>" method="post" enctype="multipart/form-data" name="form1" id="form1">
    <label for="select"></label>
    <hr />
    <label for="select">Sección : </label>
    <select name="select" id="select">
      <option value="0" selected="selected">Seleccionar</option>
      <option value="1">Compra y Venta</option>
      <option value="2">Clases</option>
    </select>
    <p>
      <label for="label">Ubicación : </label>
      <select name="select2" id="label">
        <option value="0">Seleccionar </option>
        <option value="1">Montevideo</option>
        <option value="2">Canelones</option>
      </select>
    </p>
    <hr />
    <p>
      <label for="textfield">Precio : </label>
      <input name="textfield" type="text" id="textfield" size="10" />
      <label for="label3">Moneda :</label>
      <select name="select3" id="label3">
        <option value="0">Seleccionar</option>
        <option value="1">Pesos </option>
        <option value="2">Dolar</option>
      </select>
    </p>
    <p>Titulo : 
      <label for="label4"></label>
      <input type="text" name="textfield2" id="label4" />
    </p>
    <p>Descripci&oacute;n : </p>
    <p>
      <label for="textarea"></label>
      <textarea name="content" cols="60" rows="14"></textarea>
    </p>
    <hr />
    <p>
      <label for="label5">E-mail : </label>
      <input type="text" name="textfield3" id="label5" />
      <label for="Submit">Repetir E-mail : </label>
      <label for="label6"></label>
      <input type="text" name="textfield4" id="label6" />
      <label for="Submit"><br />
      <br />
      T&eacute;lefono : </label>
      <label for="label7"></label>
      <input type="text" name="textfield5" id="label7" />
      <label for="Submit"><br />
      <br />
      </label>
      <label for="file">Imagen : </label>
      <input type="file" name="file" id="file" />
      <label for="Submit"><br />
      <br />
      </label>
      <label for="label8"></label>
      <label for="Submit"></label>
      <input type="submit" name="Submit" value="Enviar" id="Submit" />
      <label for="label2"></label>
      <input type="reset" name="Submit2" value="Restablecer" id="label2" />
    </p>
  </form>
</div>
</body>
</html>
<script language="javascript"
    type="text/javascript" src="../editor/scripts/tiny_mce.js"></script>
    </label>
    <p>
      <script language="javascript" type="text/javascript" src="../editor/scripts/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
    mode : "textareas",
    theme : "advanced",
    theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_path_location : "bottom",
    extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script> 
<?php require_once('Connections/anuncios.php'); ?>
<?php
function GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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")) {
  
$insertSQL sprintf("INSERT INTO formulario (id_rubro, seccion, ubicacion, precio, simbolo, Titulo, Descripcion, email, repetir_email, telefono, Imagen) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['id_rubro'], "int"),
                       
GetSQLValueString($_POST['seccion'], "select"),
                       
GetSQLValueString($_POST['ubicacion'], "select2"),
                       
GetSQLValueString($_POST['precio'], "textfield"),
                       
GetSQLValueString($_POST['simbolo'], "select3"),
                       
GetSQLValueString($_POST['Titulo'], "textfield2"),
                       
GetSQLValueString($_POST['Descripcion'], "content"),
                       
GetSQLValueString($_POST['email'], "textfield3"),
                       
GetSQLValueString($_POST['repetir_email'], "textfield4"),
                       
GetSQLValueString($_POST['telefono'], "textfield5"),
                       
GetSQLValueString($_POST['Imagen'], "file"));

  
mysql_select_db($database_anuncios$anuncios);
  
$Result1 mysql_query($insertSQL$anuncios) or die(mysql_error());

  
$insertGoTo "untitledcopia.php";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}
?>
lo que no logro es que lo que escribo se guarde en la base de datos y luego pueda verlos?

si alguien me puede ayudar muy agradecido....