SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    foetus cant get confirmation page


    http://www.pauserefreshment.co.uk/co...e-request.html

    As a complete foetus in the world of php for web forms Ive gone through a plantation of coffee just to get this form to ping back the info to my inbox.

    But just as I thought the feeling of pushing boulders up hill was over Ive opened up another conundrum and its this:

    I would like an idiots guide regarding how to get a confirmation thank you page to pop up after the user hits the submission page / order brouchure button. Whilst I know how to do a web page (well sort off) theres a bit of code I need to put in the php to get it to re-route to a thank you page.

    Please could a sitepoint member give me a clue regarding what this code might be.

    Any insights welcome :-)
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    A hint you say?

    header()
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AnthonySterling View Post
    A hint you say?

    header()
    Hey Ant.. thats definately a hint but my brain hurts please dont make me work it out. Any chance you could spoon feed me and tell me exactly what to do with it.

    I'm of course testing your altruism, if I was you I'd leave me too it :-)
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  4. #4
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    form.html -> script.php -> message.html

    PHP Code:
    <?php
    if('POST' === $_SERVER['REQUEST_METHOD']){
      
    /**
       *  Here we would save or email
       *  the information sent by the form
       */
      
    header('Location: http://www.example.org/thank-you.html');
      exit;
    }
    header('Location: http://www.example.org/failed.html');
    exit;
    ?>
    Create a form, have it submit to the script above, it uses the header function call to send a 'location' header indicating where the browser should go to.

    Try it.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  5. #5
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Ant - ended up just adding:

    header('Location: http://www.pauserefreshment.co.uk');
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  6. #6
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Excellent, glad you sorted it buddy.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •