Pero ahora tengo otro problema, "contacto" se compone de 3 paginas, contacto1, contacto2 y contacto3.php.
La principal es contacto1, y pongo ese script redireccionando hacia ella. En la "contacto2.php", funciona perfectamente, pero en contacto3.php no:
Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML LANG="Spanish">
<HEAD>
<TITLE>cualquierlibro.es - Resultados del envío</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="DC.Language" SCHEME="RFC1766" CONTENT="Spanish">
<META NAME="AUTHOR" CONTENT="markmb">
<META NAME="REPLY-TO" CONTENT="[email protected]">
<LINK REV="made" href="mailto:[email protected]">
<META NAME="DESCRIPTION" CONTENT="Descargar, aportar o pedir libros, gratis!">
<META NAME="KEYWORDS" CONTENT="descarga,descarga directa,DD,libro,libros,gratis,gratuito,comentar,contactar">
<META NAME="Resource-type" CONTENT="Document">
<META NAME="Revisit-after" CONTENT="2 days">
<META NAME="robots" content="ALL">
<script type="text/javascript">
function redireccionar() {
var origen = document.referrer.split("/").pop();
if (origen!="contacto1.php") window.location.href= "contacto1.php";
}
</script>
<?php
include ("incluir/template.inc.php")
?>
</head>
<body onactivate="redireccionar()">
<table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000" bgcolor="#666666">
<tr>
<td valign="top" bordercolor="#000000" bgcolor="#666666" class="textonormal">
<?php
require("PHPMailer/class.phpmailer.php");
if ($_POST['action'] == "send") {
$mail = new PHPMailer();
$mail->Host = "server35.000webhost.com";
$mail->From = $_POST ['email'];
$mail->FromName = $_POST ['nombre'];
$mail->Subject = "Comentario de cualquierlibro.es";
$mail->AddAddress("[email protected]");
if ($varname != "") {
$mail->AddAttachment($vartemp, $varname);
}
$body = "<strong>Mensaje</strong><br><br>";
$body.= $_POST['comentario']. "<br>";
$body.= "Enviado por : " .$_POST ['email'];
$mail->Body = $body;
$mail->IsHTML(true);
$mail->Send();
}
?>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
Puede ser que sea porque PHP hace antes que Javascript??NO LO SE!!!!
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
![Negando](http://static.forosdelweb.com/fdwtheme/images/smilies/negar.gif)
![Negando](http://static.forosdelweb.com/fdwtheme/images/smilies/negar.gif)
![Negando](http://static.forosdelweb.com/fdwtheme/images/smilies/negar.gif)
![Negando](http://static.forosdelweb.com/fdwtheme/images/smilies/negar.gif)
![triste](http://static.forosdelweb.com/fdwtheme/images/smilies/frown.png)
![triste](http://static.forosdelweb.com/fdwtheme/images/smilies/frown.png)
![triste](http://static.forosdelweb.com/fdwtheme/images/smilies/frown.png)
Muchas gracias!!!!