Arturo01 de Septiembre del 2004
PreguntaHola, estoy creando una forma de contactos que al llenarse y hacer click en enviar debe guardar esos registros en una base de datos, y tengo dos dudas, ( trabajo con Dreamweaver ), uno es que quiero que a la vez que se guarden los datos, llegue un email avisando que alguien ha llenado la forma ( esta solo tiene dos variables, Nombres e Email ), y lo otro es que cuando se redireccione a la pagina de confirmacion, me tome el valor de la variable Nombre y la muestre en ese documento para completar el aviso tipo: " Gracias [Valor de la variable], tus datos han sido correctos ", el script que estoy usando es el que trae los behaviors de servidor de Dreamweaver, en especial el de Insert Record, y es este:
<?php require_once('../Connections/Arturo.php'); ?><?phpfunction 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 = $HTTP_SERVER_VARS['PHP_SELF'];if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];}if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "mailing")) { $insertSQL = sprintf("INSERT INTO listas (Nombres, Email) VALUES (%s, %s)", GetSQLValueString($HTTP_POST_VARS['Nombres'], "text"), GetSQLValueString($HTTP_POST_VARS['Email'], "text")); mysql_select_db($database_Arturo, $Arturo); $Result1 = mysql_query($insertSQL, $Arturo) or die(mysql_error()); $insertGoTo = "ok.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo));}mysql_select_db($database_Arturo, $Arturo);$query_RSlistas = "SELECT * FROM listas";$RSlistas = mysql_query($query_RSlistas, $Arturo) or die(mysql_error());$row_RSlistas = mysql_fetch_assoc($RSlistas);$totalRows_RSlistas = mysql_num_rows($RSlistas);?>
Alguien me puede ayudar por favor?
Gracias
<?php require_once('../Connections/Arturo.php'); ?><?phpfunction 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 = $HTTP_SERVER_VARS['PHP_SELF'];if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];}if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "mailing")) { $insertSQL = sprintf("INSERT INTO listas (Nombres, Email) VALUES (%s, %s)", GetSQLValueString($HTTP_POST_VARS['Nombres'], "text"), GetSQLValueString($HTTP_POST_VARS['Email'], "text")); mysql_select_db($database_Arturo, $Arturo); $Result1 = mysql_query($insertSQL, $Arturo) or die(mysql_error()); $insertGoTo = "ok.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo));}mysql_select_db($database_Arturo, $Arturo);$query_RSlistas = "SELECT * FROM listas";$RSlistas = mysql_query($query_RSlistas, $Arturo) or die(mysql_error());$row_RSlistas = mysql_fetch_assoc($RSlistas);$totalRows_RSlistas = mysql_num_rows($RSlistas);?>
Alguien me puede ayudar por favor?
Gracias
