Vampen Posted February 15, 2007 Share Posted February 15, 2007 Hello. Can someone please give me a tip here how to go directly to the previous page after visiting this one? I press send mail and i go to send_mail.php Here is the code <?php $id = $_GET['id']; function kobleTil($databasenavn) { $vert = "localhost"; $bruker = "xxxx"; $passord = "xxxx"; $tilkobling = mysql_connect($vert, $bruker, $passord); if (!$tilkobling) { die("Kunne ikke koble til: " . mysql_error()); } $valgtDB = mysql_select_db($databasenavn, $tilkobling); if (!$valgtDB) { die("Kunne ikke bruke databasen: " . mysql_error()); } return $tilkobling ; } define("TILBAKE", "<p><a href='javascript:history.go(-1)'>Tilbake</a>"); ?> <?php $tilkobling = kobleTil("xxxx"); //Her hentar eg fram igjen funksjonen $sql = "SELECT * from annonse,bruker where idannonse = $id and bruker.idbruker=annonse.bruker_idbruker"; $resultat = mysql_query($sql, $tilkobling); $rad = mysql_fetch_array( $resultat ); $navn = $_POST['navn']; $bruker_epost = $_POST['bruker_epost']; $melding = $_POST['melding']; $_epost2 = $rad['epost']; $_navn = $rad['navn']; $annonse = $rad['overskrift']; $id = $_GET['id']; mail("$_epost2","Ny melding fra xxxx.net","Kjære $navn. \n\nDu har fått ei melding fra xxxx.net der du har lagt ut annonsa: \n\n $annonse.\n\nMelding er som føljane:\n\n$melding\n\n Beskjed sendt av:\n\n Navn: $navn \n Epost: $bruker_epost\n"); echo "<br><br><center><IMG SRC='grafikk/ANNONSA.jpg'></center>"; echo "<META HTTP-EQUIV='refresh' content='5;URL=http://bustad.net/vis_ann.php?id=".$id.">"; ?> On the second last line here i got the meta tag. This is working nice in Firefox, but in IE it just displays the whole HTML code. Also tried to use header but this didn't work. Nothing happens. Thx! Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 16, 2007 Share Posted February 16, 2007 that method or refresh HAS to go in the HEAD section of your html NOT in the body. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.