Hi. I'm trying to do a form which posts to a page called "post.php" which includes a mail send function and then a redirect to the previous page, with an alert claiming the form submit was successful. The code for my redirect (embedded in the php page) is as follows: $str="<script language=\"javascript\">"; $str.="document.location.href='http://www.myurl.com?alert=1';"; $str.="</script>"; return $str; PHP: but for some reason, it just doesn't work. I tried window.location and also window.location.href but as far as I know they should all work. Am I missing something here? Thank you.