Link to home
Start Free TrialLog in
Avatar of weikelbob
weikelbobFlag for United States of America

asked on

header:Location not working

What could be the reason the header:Location... below is not redirecting the browser?:

link:  http://www.owndesigns.com/listen-newsletter/website/contact.html

<?php

$message = "Hello";
if (!mail('weikelbob@aol.com','From Listen Website',$message)) die('Mail Failed!');
header("Location: http://www.owndesigns.com");
exit();
?>  
Avatar of Tomeeboy
Tomeeboy
Flag of United States of America image

I don't see a problem with the header() syntax.  What browser are you testing this with?  Have you tried a different one?
ASKER CERTIFIED SOLUTION
Avatar of Tomeeboy
Tomeeboy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You should get rid of the die() before the header().
I tested your form.. it doesn't appear to be a browser issue.  However, it does look like there is a possibly a blank line being output before your header function is called.  Make sure there is no blank space before your PHP tags in handler.php, I suspect there is.
The die couldn't be his problem, as it would be outputting "Mail Failed!" if it were being called.
Avatar of weikelbob

ASKER

Tomeeboy hit it right on the nose. There was a blank space at the top of my script. That simple!

Thanks!.
No problem!  Glad it was that simple ;)