I am having a problem with URL redirection using a mail submission form.

The form is working and sends the mail successfully, the problem lies when I try to redirect the user to a thankyou.php page using header('Location: http://blah.com/blah.php');

When the form is filled in and submitted, the mailform.php page executes but the redirection does not occur, I just get the blank page mailform.php.

Searching the web over my syntax for the header() script looks correct, is there anyway to debug this to see what exactly is occurring? Do I need to do anything on the server side in order to allow this function to work properly?

Thx
Are you making sure you don't output anything before the header()? http://us.php.net/manual/en/function.header.php

edit: welcome to Cemetch btw. I hope you'll make a post in the Introduce Me topic located in General Open Topic and tell us about yourself Smile
To debug scripts you may find enabling error reporting and displaying errors useful:


Code:
error_reporting(E_ALL);
ini_set('display_errors', true);


It would be a good idea to remove that code before putting the code into production. You can check errors on live sites by reading the server's error log.
Notice the user's signature. It's a spambot. Sad
What signature :/
_player1537 wrote:
What signature :/
I am too lazy to actually make my own post so instead I quote people and then don't say anything new

But, I suspect it's already been removed Wink
_player1537 wrote:
What signature :/
The linkspam to a PHP tutorial site that I removed when I deactivated the bot's account. Razz
Oh, now that you say that, I do remember the signature. I thought it was weird that he had a link to a topic regarding his own question, bt I figured it was a link to a topic where he asked the question (even after going to the site)
_player1537 wrote:
Oh, now that you say that, I do remember the signature. I thought it was weird that he had a link to a topic regarding his own question, bt I figured it was a link to a topic where he asked the question (even after going to the site)
Haha, I guess that shows that you think the best of everyone, which is a good thing. As you can see, I've chosen to leave this topic for future reference.
I do my best Razz
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement