Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/12/2011, 05:52
rafaxusirati
 
Fecha de Ingreso: julio-2010
Ubicación: Cerca Sitges (Barcelona)
Mensajes: 98
Antigüedad: 13 años, 9 meses
Puntos: 4
Respuesta: Enviar formulario de contacto sin mostrar email del destinatario

form.2 (= anterior, pero con acceso a BD)

Código PHP:
Ver original
  1. <?php require_once('../Connections/contactos.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33.  
  34. mysql_select_db($database_contactos, $contactos);
  35. $query_Recordset1 = "SELECT * FROM contactos ORDER BY fechaentrada DESC";
  36. $Recordset1 = mysql_query($query_Recordset1, $contactos) or die(mysql_error());
  37. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  38. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  39. ?>
  40. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  41. <html xmlns="http://www.w3.org/1999/xhtml">
  42. <head>
  43. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  44. <title>Fornmulario de Contactos</title>
  45. </head>
  46.  
  47. <body>
  48. <h3>Formulario de Contactos</h3>
  49. <form id="form1" name="form1" method="post" action="procesar.php">
  50.   <label> Ingrese su nombre <br />
  51.   <input name="nombre" type="text" id="nombre" />
  52.   <br />
  53.   </label>
  54.   <p>Su direcci&oacute;n Email<br />
  55.     <input name="email" type="text" id="email" />
  56.   </p>
  57.   <p>Su N&uacute;mero de tel&eacute;fono <br />
  58.     <input name="telefono" type="text" id="telefono" />
  59. </p>
  60.   <p>Tipo de contacto y tratamiento<br />
  61.     <label>
  62.     <select name="tipo" id="tipo">
  63.       <option value="primavera">Primavera</option>
  64.       <option value="verano">Verano</option>
  65.       <option value="Otoño">Otoño</option>
  66.       <option value="invierno">Invierno</option>
  67.     </select>
  68.     </label>
  69.   </p>
  70.   <p>
  71.     <label>Mensaje<br />
  72.     <textarea name="mensaje" cols="30" rows="3" id="mensaje"></textarea>
  73.     </label>
  74. </p>
  75.   <p>
  76.     <label>
  77.     <input type="submit" name="Submit" value="Enviar Formulario &gt;&gt;" />
  78.     </label>
  79.   </p>
  80.   <p><br />
  81.   </p>
  82. </form>
  83.  
  84. </body>
  85. </html>
  86. <?php
  87. mysql_free_result($Recordset1);
  88. ?>