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

displaying entry number in success message


  1. thewebmaven
    Member

    i want to display the entry number of a form along with the success message ..how do i do that?

    Posted 16 years ago #
  2. redityo

    Hi..

    You have to edit view-functions.php and post_functions.php to do that. I assume you will display element_1 input on form 1 success message.

    1. post_functions.php add to line 948

    //retrieve the data from element
    if ($key == 'element_1' && $form_id == '1') {
    	$_SESSION['form_element_data'] = $value;
    }

    2. view_functions.php edit line 2243

    from

    <h2>{$form->success_message}</h2>

    to

    <h2>{$form->success_message}<hr />YOUR INPUT {$_SESSION['form_element_data']}</h2>

    MachForm Support

    Posted 16 years ago #
  3. thewebmaven
    Member

    Well almost the solution.. :) But i want to display the entry number of the form ...not element or input details.... which is the form data.....can u help me out with that...

    the entry number is the form entry number that is recorded in the backend entries ... when a form is submitted.

    Posted 16 years ago #
  4. redityo

    I see, you want to get id number of your data in database. So you can ignore the first modification (post_functions.php line 948) and insert this following code below line 1013 in post_functions.php

    //retrieve the id from last inserted data
    if ($form_id == '1') {
       $_SESSION['form_element_data'] = $record_insert_id;
    }

    MachForm Support

    Posted 16 years ago #
  5. bsimpson
    Member

    i did the above and and it works in firefox, it does not work on IE7, even when the site is added to trusted sites and forced to take all cookies.

    I am using this to allow a link to bookmark your form details

    added to view-functions 2065-
    a href="/view_entry.php?form_id=1&id={$_SESSION['form_element_data']}">bookmark form results</a

    Posted 16 years ago #
  6. yuniar

    bsimpson -- what didn't work?

    displaying the link itself or clicking the "bookmark form result" link?


    MachForm Founder

    Posted 16 years ago #
  7. bsimpson
    Member

    the link displays (as it is manually added to the view functions file) but the id does not display
    the link reads "a href="/view_entry.php?form_id=1&id=">bookmark form results</a "

    where it is just blank or it will print
    id=&PHPSESSID=b6dc60fc986d4e0c00498bc732dfd8f6

    Posted 16 years ago #
  8. bsimpson
    Member

    after some more experimenting, it works fine if i use the link
    /view.php?id=1
    to view the form, but if i use the php embed method it does not work on IE 6/7

    Posted 16 years ago #
  9. yuniar

    ahh.. so you are using php embed code?

    if so, on the page where you embed the php code, insert this line:

    <?php session_start(); ?>

    It should be placed at the very top of your page (line 1).


    MachForm Founder

    Posted 16 years ago #
  10. bsimpson
    Member

    thanks that worked, you guys have great support.

    Posted 16 years ago #
  11. frungimi
    Member

    how can we show all of the form submission info?

    Posted 15 years ago #
  12. yuniar

    Hmm..if you need to show all form submission info, I suggest to just enable "form review".

    That would display all the entry prior submitting.


    MachForm Founder

    Posted 15 years ago #
  13. firstarsbrnwhite
    Member

    I don't know what I am doing wrong here. Simply trying to get DATA ID for confirmation number on form for users. I have added the line of code to line 1013. Now the chunk looks like this.

    //start insert query ----------------------------------------
    $field_list = substr($field_list,0,-1);
    $field_values = substr($field_values,0,-1);

    if(empty($form_review)){
    $query = "INSERT INTO ap_form_{$form_id} ($field_list) VALUES ($field_values);";
    }else{ //insert to temporary table, if form review is enabled
    $query = "INSERT INTO ap_form_{$form_id}_review ($field_list) VALUES ($field_values);";
    //retrieve the id from last inserted data
    if ($form_id == '1') {
    $_SESSION['form_element_data'] = $record_insert_id;
    }
    }

    do_query($query);

    $record_insert_id = mysql_insert_id();
    //end insert query ------------------------------------------

    and I have made success message

    <h2>{$form->success_message}<hr />YOUR CONFIRMATION # {$_SESSION['form_element_data']}</h2>

    The form success page just says "YOUR CONFIRMATION #" with no number after it. I am not a PHP guru

    Posted 15 years ago #
  14. redityo

    have you add this code

    <?php session_start(); ?>

    in the first line of your success page ?


    MachForm Support

    Posted 15 years ago #
  15. firstarsbrnwhite
    Member

    Using iframe embed in the page... adding the line of code didn't help

    Here are the two codes I edited. Around the lines suggested in this thread.

    http://tiny.cc/I65no

    Posted 15 years ago #
  16. firstarsbrnwhite
    Member

    anything on this? still having trouble. I would like it so the customer receives a confirmation # and the confirmation # also appears in the email notification title.

    Posted 15 years ago #
  17. redityo

    I found these custom code in "post-functions.php" is around line 1015 ~ 1017 :

    if ($form_id == '1') {
    $_SESSION['form_element_data'] = $record_insert_id;
    }

    try to move those code after this line (line 1022)

    $record_insert_id = mysql_insert_id();

    Don't forget to change the form ID's also. However if the problem still persist, please send your FTP login info to :

    customer.service[at]appnitro.com

    I'll help you with the customization


    MachForm Support

    Posted 15 years ago #
  18. carlosalvidrez
    Member

    Hi guys, is there a more recent/updated version of this guide? I'd like to be able to do this with the latest version (as of today, June 2013). It seems like this thread was created 4 years ago, and thus the question.

    Thanks!

    Posted 11 years ago #

RSS feed for this topic

Reply