Citywalks: La mejor forma de descubrir la ciudad
$lafecha = date("Y-m-d");
if(isset($_POST['envio'])){
// check what the user has entered matches what is in the session
if(isset($_POST['imagetext'])&&strlen($_POST['imagetext'])==7&&isset($_SESSION['text'])&&
strtolower($_POST['imagetext'])==$_SESSION['text'])
{
//echo 'input text matches that on the image';
$envioelemail='si';
}
// there was no match
elseif(isset($_POST['imagetext']))
{
//echo 'input text doesn\'t match the text on the image';
?>
}
unset($_SESSION['text']);
if($envioelemail=='si'){
/*
$campos = "fecha,nombre,idioma,poblacion,tipo,comentarios";
//
$valores = "'".$_POST['fecha']."',";
$valores .= "'".$_POST['nombre']."',";
$valores .= "'".$_POST['idioma']."',";
$valores .= "'".$_POST['poblacion']."',";
$valores .= "'".$_POST['tipo']."',";
$valores .= "'". htmlentities(addslashes($_POST['comentarios'])) ."'";
//nos conectamos a la bd.
$cnx2 = conectar();
$res2 = mysql_query("INSERT INTO $tabla ($campos) VALUES($valores)") or die (mysql_error());
*/
$enviadopor = "ricard@con-amor.com";
$oculto = "ricard@con-amor.com";
$header = "Content-type: text/html; charset=iso-8859-1 \r \n";
$header.= "From: \"$enviadopor\" <$enviadopor> \r \n";
$header.= "Reply-To: \"$enviadopor\" <$enviadopor> \r \n";
$header.= "Bcc: ".$oculto."\r\n";
$adminaddress = "ricard@con-amor.com";
$subject='Comentario de un usuario desde la web';
//aka recoge la fecha del server__________________________________________________________________________
$fecha = date("d/m/Y");
$envio1 = mail($adminaddress,$subject,$mensaje_cliente,$header);
$enviado='si';
$nombre='';
if(envio1){
echo $SERVER['PHP_SELF'];
}
// mysql_close($cnx);
//mensaje de exito.
};
}
//convertir de fecha formato americano de php de un campo date
//a formato español
function fechaEuropea ($fecha) {
setlocale(LC_CTYPE, 'es');
setlocale (LC_TIME,"spanish");
$fechaFinal = str_replace ("De","de",ucwords(strftime("%d de %B de %Y", mktime(substr($fecha,11,2),substr($fecha,14,2),substr($fecha,17,2),substr($fecha,5,2),substr($fecha,8,2),substr($fecha,0,4)))));
return ($fechaFinal);
}
function fechaEuropeaBarras ($fecha) {
$fechaFinal = substr($fecha,8,2) . "/" . substr($fecha,5,2) . "/" . substr($fecha,0,4);
return ($fechaFinal);
}
function cambiaf_a_mysql($fecha){
ereg( "([0-9]{1,2})/([0-9]{1,2})/([0-9]{2,4})", $fecha, $mifecha);
$lafecha=$mifecha[3]."-".$mifecha[2]."-".$mifecha[1];
return $lafecha;
}
//$tabla="gogos";
$cnx = conectar();
$res = mysql_query("SELECT * FROM $tabla ORDER BY fecha DESC") or die (mysql_error());
?>