Grow your CSS skills. Land your dream job.

[Solved] Redirect After Form Submisson ??

  • # August 10, 2009 at 8:44 am

    I tried the tutorial written by Chris : Sending Nice HTML Email with PHP

    now I got problem with redirecting to other page after form is submitted, I already tried several methods found around the internet, but wasn’t work for me… :)

    here my form: http://www.fleedy.com/bgmail

    Please Guide me how to make redirection..

    TQ in Advance..

    # August 10, 2009 at 12:58 pm

    Just posting the form link unfortunately doesn’t show the code you are using…

    Redirects in PHP are usually done using the header function: http://us2.php.net/manual/en/function.header.php

    an example:

    Code:
    < ?php
    header('Location: http://www.example.com/');
    ?>
    # August 10, 2009 at 2:13 pm

    (moved to PHP Section)

    Falken is correct, the header function is what you’re looking for. A lot of people have it set up like this:

    if form fails {
    header(fail-page)
    }

    else {
    header(success-page)
    }

    # August 10, 2009 at 3:52 pm

    TQ for your kind responses….

    I fixed the errors after referring: [http://css-tricks.com/forums/viewtopic.php?f=6&p=14544] + some other factors.

    the header function already tried, but not in the right place… that’s why i failed..

    after submitted, form will be call [websitechange.js] which is external js file that contain thank you message.
    I just modified the js file. [Problem Solved].

    TQ for helping…. :)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".