Tengo una página que tiene una base de datos con posibles clientes con los siguientes campos (ref. Nombre usuario, mailcontacto, titulo...).
Tengo 3 formularios.
1º Form. aparece el listado de posibles clientes que se encuentran ya introducidos en la base de datos (referencia, nombre y trabajo a realizar)
2º Form. la persona que quiera contactar con el futuro cliente del form.1, tiene que rellenar un formulario, que será enviado al cliente del form.1
2º Form. igual que el anterior, pero con acceso a base de datos
3º Form. donde supuestamente se debería de enviar la información introducida en el form.2 a los clientes del form.1
los form.2, supuestamente son iguales, pero 1 tiene acceso a la base de datos, donde se supone que tendría que obtener la información del mail, donde posteriormente enviará la información.
Lo que pretendo es que, la persona que quiera contactar con uno de los clientes del listado del form.1 pueda hacerlo, pero sin que pueda saber su mail. Para ello tendrá que rellenar un formulario (form.2) introduciendo su nombre, mail, y un posible mensaje).
Posteriormente, la persona del form.1, recibiría los datos de la persona que quiere contactar con el.
En ningun momento, me interesa que se muestre el mail del listado form.1.
¿cómo se pueden arreglar los códigos?
Muchas gracias.
form1.
Código PHP:
Ver original
<?php require_once('../Connections/contactos.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $maxRows_Recordset1 = 10; $pageNum_Recordset1 = 0; $pageNum_Recordset1 = $_GET['pageNum_Recordset1']; } $startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1; $query_Recordset1 = "SELECT * FROM contactos ORDER BY fechaentrada DESC"; $query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1); $totalRows_Recordset1 = $_GET['totalRows_Recordset1']; } else { } ?> <p>Clientes mantenimiento comunitario.</p> <?php do { ?> <table width="50%" border="0"> <tr> <td><div align="left">ref: <?php echo $row_Recordset1['idempleado']; ?></div></td> </tr> <tr> <td><div align="left">Nombre: <a href="http://mipaginadejardineria/contactar.php"><?php echo $row_Recordset1['nombre']; ?></a></div></td> </tr> <tr> <td><div align="left">Faena a realizar: <?php echo $row_Recordset1['tituloanuncio']; ?></div></td> </tr> </table> <p> </p> <?php ?>
form.2
Código PHP:
Ver original
<!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>Fornmulario de Contacto</title> </head> <body> <h3>Formulario de Contactos</h3> <form id="form1" name="form1" method="post" action="procesar.php"> <label> Ingrese su nombre <br /> <input name="nombre" type="text" id="nombre" /> <br /> </label> <p>Su dirección Email<br /> <input name="email" type="text" id="email" /> </p> <p>Su Número de teléfono <br /> <input name="telefono" type="text" id="telefono" /> </p> <p>Tipo de contacto y tratamiento<br /> <label> <select name="tipo" id="tipo"> <option value="primavera">Primavera</option> <option value="verano">Verano</option> <option value="Otoño">Otoño</option> <option value="invierno">Invierno</option> </select> </label> </p> <p> <label>Mensaje<br /> <textarea name="mensaje" cols="30" rows="3" id="mensaje"></textarea> </label> </p> <p> <label> <input type="submit" name="Submit" value="Enviar Formulario >>" /> </label> </p> <p><br /> </p> </form> </body> </html>
form.3
Código PHP:
Ver original
<?php require_once('../Connections/contactos.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $query_Recordset1 = "SELECT * FROM contactos ORDER BY fechaentrada DESC"; // ¿supuestamente, aquí debería de obtenerse los datos del EMAIL DE LA BASE DE DATOS? $asunto = $_POST["tipo"]; $mailheader = "From: ".$_POST["email"]."\r\n"; $mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; $MESSAGE_BODY = "Nombre: ".$_POST["nombre"]."<br>"; $MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; $MESSAGE_BODY .= "Telefono: ".$_POST["telefono"]."<br>"; $MESSAGE_BODY .= "Tipo de contacto: ".$_POST["tipo"]."<br>"; //MODIFICAR A LA DIRECCIÓN EN SU SERVIDOR ?>