Jump to content


Photo

Mail script help


  • Please log in to reply
2 replies to this topic

#1 tworedballs

tworedballs
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 October 2006 - 06:01 PM

I have written a standard mail script from a tutorial for my website.  I have everything working, but I want my user to either be redirected after the script was executed or to give them a link to click on that will take them back to the home page.  I'm not well versed in PHP as I do most of my stuff in HTML, ActionScript and Java.  Can anyone help me?  I want them to be redirected to www.mywebsite.com  Thanks in advance!

#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 25 October 2006 - 06:12 PM

<?php

Redirect("path/to/your/index.php"); //Maybe even Redirect("http://www.mywebsite.com"); will work too, haven't needed that for my needs

function Redirect($url) {
	   if(headers_sent()) {
			   echo "<script type='text/javascript'>location.href='$url';</script>";
	   } else {
			   header("Location: $url");
	   }
}

?>



#3 tworedballs

tworedballs
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 October 2006 - 06:14 PM

thanks.  I'll try that this afternoon when I get back to my computer.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users