http://corozal.gov.co/ficelnew/formularnew.php
el cual al llenarse envia dos mensajes uno a la persona que lo diligenció y otro como control de igual manera envia lso datos a una BD, lo pueden probar..
todo hasta alli funciona perfecto....
Código PHP:
<?php
//CONEXION CON BASEDE DATOS===========================
$dbName = "basededatos";//nombre de la Base de datos
$tabla="mitabla";
$hostname="localhost";
$username = "misuario";//usuario
$password = "micontraseña";//contraseña
//====================================================
mysql_connect($hostname,$username,$password)or
print "Error en la conexión";
mysql_select_db("$dbName") or
print "Error en la base de datos";
// CONEXION DE VARIABLES DE LA TABLA EN BASEDE DATOS=====================
$prefijo = substr(md5(uniqid(rand())),0,20);
$nombres = $_POST['nombres'];
$tipoidentificacion = $_POST['tipoidentificacion'];
$identificacion = $_POST['identificacion'];
$email = $_POST['email'];
$fecha = $_POST['fecha'];
$link = $_POST['identificacion'].$prefijo;
?>
<?
$status = "";
if ($_POST["action"] == "upload") {
$consulta="Insert into $tabla values ('$id', '$nombres','$tipoidentificacion','$identificacion','$email','$fecha','$link')";
$resultado=mysql_query($consulta);
//$boundary = md5(time().rand(1, 100));
$fecha = date("d-M-y H:i");
//$ip = $_SERVER["REMOTE_ADDR"];
$contenido='<html>
<head>
<title>Formulario de Industria y Comercio Municipio de Corozal</title>
</head>
<body link="/* CCCCCC" vlink="/* FFFFFF" alink="/* CC0033">
<table width="550" height="314" border="0" align="center">
<tr>
<th width="550" height="310"> <table width="550" height="329" border="0">
<tr>
<td width="550" height="18" align="center" valign="middle" bgcolor="/* 666666">
<p><font color="/* FFFFFF" size="-1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Formulario de Industria y Comercio Solicitado Recientemente</strong></font><br>
<br>
</p></td>
</tr>
<tr>
<th width="550" height="200"><table width="550" height="156" border="0">
<tr>
<td width="117" height="20" align="left" valign="middle" bgcolor="/* CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Nombre Entidad:</font></td>
<td width="423" height="20" align="left" valign="middle" bgcolor="/* 0099CC"><font color="/* FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">' . ucwords($_POST["nombres"]) . '</font></font></font></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" bgcolor="/* CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Tipo Identificación:</font></td>
<td height="20" align="left" valign="middle" bgcolor="/* 0099CC"><font color="/* FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">' . $_POST["tipoidentificacion"] . '</font></font></font></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" bgcolor="/* CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Identificación:</font></td>
<td height="20" align="left" valign="middle" bgcolor="/* 0099CC"><font color="/* FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">' . $_POST["identificacion"] . '</font></font></font></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" bgcolor="/* CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Email:</font></td>
<td height="20" align="left" valign="middle" bgcolor="/* 0099CC"><font color="/* FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">' . $_POST["email"] . '</font></font></font></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" bgcolor="/* CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Fecha:</font></td>
<td height="20" align="left" valign="middle" bgcolor="/* 0099CC"><font color="/* FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif"><font size="1">' . $_POST["fecha"] . '</font></font></font></td>
</tr>
</table>
</body>
</html>';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=UTF-8 \r\n";
$headers .= "From:". $_POST["email"] ."\n";
$asunto = "Solicitud Formulario Industria y Comercio de: " . $_POST["nombres"];
mail("[email protected]", $asunto, $contenido, $headers);
$mensaje= '<html>
<head>
<title>Municipio de Corozal - Sucre</title>
</head>
<body link="/* 666666" vlink="/* 999999" alink="/* CCCCCC">
<br>
<table width="588" height="409" border="0" align="center">
<tr>
<td width="582" height="405" align="center" valign="top">
<table width="574" height="134" border="0">
<tr>
<td width="568" height="130"><img src="http://www.corozal.gov.co/ficel/logomensajealcaldia.gif" width="529" height="85"></td>
</tr>
</table>
<table width="581" height="269" border="0">
<tr>
<td width="575" height="265" background="http://www.corozal.gov.co"><blockquote>
<p><span style="font-size: 12px"><b><br>
<br>
' . strtoupper($_POST["nombres"]). '</b> </span><span style="font-size: 12px">ya se encuentra disponible su formulario de Industria y Comercio en Linea, el cual puede descargar a Continuacion: <br>
<br>
</span><a href="http://corozal.gov.co/ficelnew/consulta/generar.php?link=' . $link .'"><strong>DESCARGAR FORMULARIO</strong></a><strong></strong>
<p><span style="font-size: 12px">Gracias por usar nuestros servicios.</span><br>
<br>
<span style="font-size: 12px"> Lineas y canales de atencion: (5) 2858657 - 314 589 1573 <br>
[email protected]<br>
<br>
</span><br>
<span style="font-size: 12px">Enviado automaticamente por nuestro sistema Ficel de la alcaldia Municipal de Corozal - Sucre</span><font color="/* 000000" size="1" face="Verdana, Arial, Helvetica, sans-serif"><br>
<br>
<br>
</font><br>
</blockquote></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>';
$cabeceras = 'MIME-Version: 1.0' . "\r\n";
$cabeceras .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$cabeceras .= 'From:[email protected]'."\n";
mail("".$_POST["email"]."", "Formulario disponible para descargar", $mensaje, $cabeceras);
}else{
echo "Información No cargada por favor Intente Nuevamente <br><br><a href=index.html target=_parent>Re-intentar</a>";
mysql_close();
}
?>
<style type="text/css">
body,td,th {
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
}
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #000000;
}
a:active {
color: #000000;
}
.io {
text-align: center;
}
.io {
font-weight: bold;
}
.io {
color: #F00;
}
</style><body style="text-align: center">
<p><br>
<img src="notification.png" width="90" height="90" alt=""/></p>
<p>Datos enviados con exito por favor revise el Correo Electronico <br>
para descargar el formulario de Industria y Comercio al Instante.</p>
<p>Gracias por usar nuestro servicio.
Código PHP:
</span><a href="http://corozal.gov.co/ficelnew/consulta/generar.php?link=' . $link .'"><strong>DESCARGAR FORMULARIO</strong></a><strong>
ahora bien si se revisa el correo que se ingreso y se da click en el vinculo DESCARGAR FORMULARIO este se debería abrirme...
pero es aquí donde me falla....
pongo parte de el script del archivo generar.php
Código PHP:
<?
$tabla = "formu";
$username = "ewal3456";
$password1 = "arthe369";
$dbName = "formularioindcor";
$hostname = "localhost";
mysql_connect($hostname,$username,$password1) or print "Error en la Conexión";
mysql_select_db("$dbName") or print "Error en la Base de datos";
$link2 = $_GET['link'];
//$consulta = "select * from $tabla where id2 = $id2";
$consulta = "SELECT * FROM $tabla WHERE link = $link2";
$resultado=mysql_query($consulta);
$id=mysql_result($resultado,0,id);
$nombres=mysql_result($resultado,0,nombres);
$tipoidentificacion=mysql_result($resultado,0,tipoidentificacion);
$identificacion=mysql_result($resultado,0,identificacion);
$email=mysql_result($resultado,0,email);
$fecha=mysql_result($resultado,0,fecha);
$link=mysql_result($resultado,0,link);
?>
<?
$factura=$id; //Ejemplo = 0058
$tamNumero = strlen($factura);
if($tamNumero==1)
$factura = "000$factura";
elseif ($tamNumero==2)
$factura = "00$factura";
elseif ($tamNumero == 3)
$factura = "0$factura";
//echo $factura;
?>
que estoy haciendo mal, que me falta para que funcione y muestre los datos.