Appnitro Software Forums » MachForm

displaying entry number in success message

(10 posts)
  • Started 3 months ago by thewebmaven
  • Latest reply from bsimpson

  1. thewebmaven
    Member

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

    Posted 3 months ago #
  2. 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>
    Posted 3 months 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 3 months ago #
  4. 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;
    }
    Posted 3 months 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 2 months ago #
  6. bsimpson -- what didn't work?

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

    Posted 2 months 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 2 months 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 2 months ago #
  9. 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).

    Posted 2 months ago #
  10. bsimpson
    Member

    thanks that worked, you guys have great support.

    Posted 2 months ago #

RSS feed for this topic

Reply

You must log in to post.