This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Referencing input data in the redirect (thanks.htm) page


  1. neilo
    Member

    I could do with some expert advice from someone with PHP knowledge and a patient disposition.

    The forms work brilliantly, and do everything they're supposed to do. But what I need to happen is that once the form has been reviewed and submitted, and has redirected to an acknowledgement page, that the acknowledgement page can identify the record (ID) that has just been submitted and be able to echo some of the data from it (Name, options etc.).

    On the redirect page I can specify the database connection and create a recodset for the table that holds the information, but I don't know how to associate the newly submitted record ID with this page - i.e. so that this page can reflect that customer's particular details.

    I have zero knowledge of PHP (although I have started working through a book) and know that this is beyond the scope of normal support issues, but would be grateful for the generosity of anyone with the skills.

    Cheers,

    Neil H

    Posted 14 years ago #
  2. redityo

    Hi Neil,

    I think you can use a SESSION variable to pull out the form data to your custom thank you page. You can look at to this post for details :

    http://www.appnitro.com/forums/topic/how-to-limit-access-to-redirect-page-after-submission?replies=13#post-3170

    But you need to have PHP page ("thanks.php") for that, not "thanks.html"


    MachForm Support

    Posted 14 years ago #
  3. neilo
    Member

    Many thanks for that, redityo - that looks perfect.

    Posted 14 years ago #
  4. neilo
    Member

    Hello Redityo,

    I followed the directions there, and in my post-functions.php file I have put the two lines where you suggested. The lines are lines 1181, 1182:

    //if there is any error message or elements, send false as status
    		if(empty($error_elements) && empty($process_result['custom_error'])){
    			$process_result['status'] = true;
    			$_SESSION['is_valid_user'] = true;
    			$_SESSION['form_data'] = $table_data;

    And in my thanks.php file which the confirm.php directs to, I have included the lines:

    <?php echo 'Dear '. $_SESSION['form_data']['element_1']; ?>
    	  , Many thanks for your entry in to our poetry competition!</p>

    The session variables don't seem to be being carried forward, because the page prints "Dear , Many thanks for your entry in to our poetry competition!"

    Do you have some advice as to where I am going wrong?

    Thanks you

    Neil H

    Posted 14 years ago #
  5. yuniar

    You need to enable session on your acknowledgement page.
    At the first line of the page, make sure to have this code:

    <?php session_start(); ?>

    MachForm Founder

    Posted 14 years ago #
  6. neilo
    Member

    Thank you so much, Yuniar and Redityo,

    It is working perfectly, - and I am so happy with it.

    Very best to you all,

    Neil H

    Posted 14 years ago #
  7. bto
    Member

    Thanks for this- it worked perfect for a project I'm working on! :-D

    Posted 13 years ago #

RSS feed for this topic

Reply