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

OK MUCHAS GRACIAS.. YA LO SOLUCIONE TE MUESTRO LOS SCRIPT


untitled.php


Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
  5. #apDiv1 {
  6.     position:absolute;
  7.     left:225px;
  8.     top:17px;
  9.     width:530px;
  10.     height:161px;
  11.     z-index:1;
  12. }
  13. </style>
  14. <div id="apDiv1">
  15.   <form action="/untitledcopia.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  16.     <p>
  17.       <label for="ubicacion"></label>
  18.       Sección :
  19.       <select name="seccion" id="select2">
  20.         <option value="Seleccionar" selected="selected">Seleccionar</option>
  21. <option value="Compra y Venta">Compra y Venta</option>
  22.         <option value="Vehiculos ">Vehiculos</option>
  23.       </select>
  24.        Ubicacion :
  25.       <select name="ubicacion" id="select3">
  26.         <option value="Seleccionar">Seleccionar</option>
  27.         <option value="Montevideo">Montevideo</option>
  28.         <option value="Canelones">Canelones</option>
  29.         <option value="Maldonado">Maldonado</option>
  30.       </select>
  31.     </p>
  32.     <p>
  33.       <label for="moneda"></label>
  34.       Precio :
  35.       <input type="text" name="precio" id="textfield2" />
  36.       <label for="moneda">Moneda : </label>
  37.       <select name="moneda" id="moneda">
  38.         <option value="Seleccionar">Seleccionar</option>
  39.         <option value="Pesos">Pesos</option>
  40.         <option value="Dolares">Dolares</option>
  41.         <option value="Euros">Euros</option>
  42.       </select>
  43.     </p>
  44.     <p>
  45.       <label for="content"></label>
  46.     Descripción :</p>
  47.     <p>
  48.   <textarea name="content" id="content" cols="45" rows="10"></textarea>
  49.     </p>
  50.     <p>
  51.       <label for="textfield3"></label>
  52.       Titulo :
  53.       <label for="titulo"></label>
  54.       <input type="text" name="titulo" id="titulo" />
  55.     </p>
  56.     <p>
  57.       <label for="telefono">T&eacute;lefono</label>
  58.       :
  59.       <input type="text" name="telefono" id="telefono" />
  60.     </p>
  61.     <p>
  62.       <label for="email">Email</label>
  63. :      
  64. <input type="text" name="email" id="email" />
  65.     <label for="repetir">Repetir Email : </label>
  66.     <input type="text" name="repetir" id="repetir" />
  67.     </p>
  68.     <p>
  69.       <label for="textfield2"></label>
  70.       <label for="imagen"></label>
  71.       Imagen :
  72.       <input type="file" name="imagen" id="imagen" />
  73.     </p>
  74.     <p>
  75.       <input type="submit" name="button" id="button" value="Enviar" />
  76.       <input type="reset" name="button2" id="button2" value="Restablecer" />
  77.     </p>
  78.   </form>
  79. </div>
  80. <p>&nbsp;</p>
  81. <p>&nbsp;</p>
  82. <p>&nbsp;</p>
  83. <p>&nbsp;</p>
  84. <p>&nbsp;</p>
  85. <p>&nbsp;</p>
  86. <p>&nbsp;</p>
  87. <p>&nbsp;</p>
  88. <p>&nbsp;</p>
  89. <p>&nbsp;</p>
  90. <p>&nbsp;</p>
  91. <p>&nbsp;</p>
  92. <?php require_once('Connections/anuncios.php'); ?>
  93. <?php
  94. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  95. {
  96.   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
  97.  
  98.   switch ($theType) {
  99.     case "text":
  100.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  101.       break;    
  102.     case "long":
  103.     case "int":
  104.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  105.       break;
  106.     case "double":
  107.       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
  108.       break;
  109.     case "date":
  110.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  111.       break;
  112.     case "defined":
  113.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  114.       break;
  115.   }
  116.   return $theValue;
  117. }
  118.  
  119. $editFormAction = $_SERVER['PHP_SELF'];
  120. if (isset($_SERVER['QUERY_STRING'])) {
  121.   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
  122. }
  123.  
  124. if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  125.    
  126.   $insertSQL = sprintf("INSERT INTO formulario (id_rubro, seccion, ubicacion, precio, moneda, titulo, content, email, repetir_email, telefono, imagen,) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
  127.                        GetSQLValueString($_POST['id_rubro'], "id_rubro"),
  128.                        GetSQLValueString($_POST['seccion'], "seccion"),
  129.                        GetSQLValueString($_POST['ubicacion'], "ubicacion"),
  130.                        GetSQLValueString($_POST['precio'], "precio"),
  131.                        GetSQLValueString($_POST['moneda'], "moneda"),
  132.                        GetSQLValueString($_POST['titulo'], "titulo"),
  133.                        GetSQLValueString($_POST['content'], "content"),
  134.                        GetSQLValueString($_POST['email'], "email"),
  135.                        GetSQLValueString($_POST['repetir'], "repetir"),
  136.                        GetSQLValueString($_POST['telefono'], "telefono"),
  137.                        GetSQLValueString($_POST['imagen'], "imagen"));
  138.  
  139.   mysql_select_db($database_anuncios, $anuncios);
  140.   $Result1 = mysql_query($insertSQL, $anuncios) or die(mysql_error());
  141.  
  142.   $insertGoTo = "untitledcopia.php";
  143.   if (isset($_SERVER['QUERY_STRING'])) {
  144.     $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
  145.     $insertGoTo .= $_SERVER['QUERY_STRING'];
  146.   }
  147.   header(sprintf("Location: %s", $insertGoTo));
  148. }
  149. ?>
  150.  <script language="javascript"
  151.     type="text/javascript" src="../editor/scripts/tiny_mce.js"></script>
  152.     </label>
  153.     <p>
  154.       <script language="javascript" type="text/javascript" src="../editor/scripts/tiny_mce.js"></script>
  155. <script language="javascript" type="text/javascript">
  156. tinyMCE.init({
  157.     mode : "textareas",
  158.     theme : "advanced",
  159.     theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
  160.     theme_advanced_buttons2 : "",
  161.     theme_advanced_buttons3 : "",
  162.     theme_advanced_toolbar_location : "top",
  163.     theme_advanced_toolbar_align : "left",
  164.     theme_advanced_path_location : "bottom",
  165.     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]"
  166. });
  167. </script>

Y untitledcopia.php


Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <table width="941" height="234" border="0">
  6.   <tr>
  7.     <td width="71">Secci&oacute;n</td>
  8.     <td width="90">Ubicacion</td>
  9.     <td width="57">Precio</td>
  10.     <td width="74">Simbolo</td>
  11.     <td width="50">Titulo</td>
  12.     <td width="106">Descripcion</td>
  13.     <td width="49">Email</td>
  14.     <td width="168">Repetir Email</td>
  15.     <td width="125">T&eacute;lefono</td>
  16.     <td width="90">Imagen</td>
  17.     <td width="15">&nbsp;</td>
  18.   </tr>
  19.   <tr>
  20.     <td><?php echo $_POST['seccion'] ?></td>
  21.     <td><?php echo $_POST['ubicacion'] ?></td>
  22.     <td><?php echo $_POST['precio'] ?></td>
  23.     <td><?php echo $_POST['moneda'] ?></td>
  24.     <td><?php echo $_POST['titulo'] ?></td>
  25.     <td><?php echo $_POST['content'] ?></td>
  26.     <td><?php echo $_POST['email'] ?></td>
  27.     <td><?php echo $_POST['repetir'] ?></td>
  28.     <td><?php echo $_POST['telefono'] ?></td>
  29.     <td><?php echo $_POST['imagen'] ?></td>
  30.   </tr>
  31. </table>

LO QUE NO PUEDO LOGRAR ES VER LA IMAGEN QUE SUBO? SERA QUE ME FALTA PONER ALGO EN EL PRIMER SCRIPT?