redirect after mail() function

cheri-100's Avatar

cheri-100

06 Sep, 2015 03:58 PM

Does this page mean I can supress that blank page that pops up after the php executes my mail() function?
http://support.cmspath.com/kb/editing-content-2/how-do-i-add-a-form-to-my-website-and-have-submissions-emailed-to-me

It says "The redirect url is required and prevents non-form-posted processing." and I'm not sure what non-form-posted processing means. I'm thinking it means supressing that blank page (based on later comments in your article.)

If so, I'm not having success. I've got as a line after my mail() function:
header("Location: " . $redirect);
Where
$redirect = "../GenAfterOnlinePayButtons.html/";

I've also tried it without the ../.
So far it still posts that blank page after running.
What am I missing? Please help!

Alternatively would solve my problems too:
With that blank page, I made a welcome screen, with a button, but that button works on my local set up but not once up loaded to the serve. Then it can't find the page. When running the php locally (the php code doesn't process but the html that puts up the button does process), and it can find the page.
      <FORM>
        <input type="BUTTON" value="CONTINUE --&raquo;" onClick="window.location.href='GenAfterOnlinePayButtons.html/'" name="BUTTON">
      </FORM>

  1. 1 Posted by Tucker on 08 Sep, 2015 04:38 PM

    Tucker's Avatar

    Hi cheri-100,

    Try it without the ../ at the beginning nor the / at the end. So, it'd just be GenAfterOnlinePayButtons.html. It'd also be worth checking to make sure that the page loads if you go to yourwebsite.com/GenAfterOnlinePayButtons.html.

    Sorry for the delayed response -- we were out of the office yesterday. Let me know if that doesn't work and I'd be glad to take a closer look.

    -Tucker

  2. 2 Posted by cheri-100 on 12 Sep, 2015 08:02 PM

    cheri-100's Avatar

    Thanks Tucker! I've got the url's working. My big question -- does the redirect allow you to run the php to email the _POST array variables without sending a blank page to the browser? Is that the point of the redirect?

    If so what's in error in how I tried to use the redirect in my original post?

    Thank you!!!

  3. 3 Posted by Tucker on 14 Sep, 2015 03:53 PM

    Tucker's Avatar

    No problem! I'm glad it works. And you're correct: the point of the redirect URL is so that the browser doesn't receive a blank page.

    There were two errors with the redirect in your original post. Having ../ at the beginning of a URL means "exit this folder, then look for the page." In this case, you don't need to exit the current folder. The page with your form and the redirect page (as well as every other page on your site) are all in the same folder.

    There was also a / after the .html. A slash at the end means that it's the name of a folder, whereas .html means you're looking at an HTML file. So .html/ is ambiguous, and will usually give you a Page Not Found error.

    Let me know if you have any other questions about that. Have a great day!

    -Tucker

  4. Colleen closed this discussion on 29 Jan, 2016 04:37 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac