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

Reset amount of entries and adding image to submission emails?


  1. MvdL79
    Member

    (yes even more questions, but simple ones though)

    Question #1:
    Maybe this is a really stupid question, but how does one reset the number of entries (form count) back to zero?

    I searched the forum, but nobody has asked this before?
    ...or did I overlook?

    Cause, even when I delete all the entries, it still keeps counting.

    Question #2:
    Is it possible to ADD an image to the notifcation email for your clients? E.g. I am currently using: <img src> in the notification email. But is it possible to include the image in the email itself, instead of loading it from the website?

    Please advice. Thanks.

    Posted 14 years ago #
  2. MvdL79
    Member

    And another question! :D

    I want to get rid of the fields on the "Review Page" which are not filled in.

    I already read and tried the solution provided at: http://www.appnitro.com/forums/topic/hiding-emptydefault-value-in-review-page?replies=4#post-6089

    However it doesn't work for me?
    If I edit the code, like provided, it still shows the field in the "Review Page" which is empty. While it shouldn't appear at all.

    I think the code has been updated since then, cause the shown lines (2438-2453) do not apply anymore as well. It seems the code has been cut down.

    Posted 14 years ago #
  3. MvdL79
    Member

    And another question and as far as I can tell, this will be really the last one. Cause after this, my form is like I want it to be!! :)

    I want to use the name of the person who filled in the form on the redirected page (after form submission). However no matter what I do, it doesn't show their names on the redirected page.

    In this post, by Yuniar, he showed me how to do this, however it doesn't work anymore with the newer MachForm (or I am doing something wrong). The post is located here: http://www.appnitro.com/forums/topic/how-to-limit-access-to-redirect-page-after-submission?replies=13#post-3170

    I quote Yuniar:

    Add this:

    $_SESSION['is_valid_user'] = true;
    $_SESSION['form_data'] = $table_data;

    Underneath here:
    $process_result['status'] = true;

    And use echo 'Dear Sir/Madam '. $_SESSION['form_data']['element_2']; in the succes(.php) page to call it, however nothing gets displayed. And yes I replaced the element with the correct one from my form. Any advice?

    Posted 14 years ago #
  4. MvdL79
    Member

    Anyone?

    Posted 14 years ago #
  5. MvdL79
    Member

    * bump *

    Posted 14 years ago #
  6. redityo

    Hello,

    For your questions :

    1. To reset entry ID number, you need open PHPMyAdmin. Go to your database and run this SQL

    ALTER TABLE ap_form_x AUTO_INCREMENT = 1;

    Change "x" with your form id, it should be like this "ap_form_2"

    2. When hiding the empty field in review page, there are 2 different location to put/change the code. First for standard embed code (line 2334 ~ 2350) and second to advance embed code (line 2438 ~ 2453), make sure you've put the code in both location. Otherwise please post your code so I can check it.

    3. It still work with me .. have you change the element id ?


    MachForm Support

    Posted 14 years ago #
  7. MvdL79
    Member

    1. I will give the SQL a go when I am done.

    2. I changed both codes and now it works! Thanks.

    3. I checked the element id, but it's correct. It should use the element from the Template Variables from the CP, right?

    Also if I use:

    <?php print_r($_SESSION['form_data']);?>

    It doesn't show anything either. :S
    Looks like it doesn't use the data from the temporary session?

    //edit

    Well I have added the following:

    $_SESSION['is_valid_user'] = true;
    $_SESSION['form_data'] = $table_data;

    after each:

    $process_result['status'] = true;

    About 4 or 5 times. But still doesn't display anything!

    Posted 14 years ago #
  8. redityo

    Have you put this code to your redirect page ?

    <?php session_start(); ?>

    MachForm Support

    Posted 14 years ago #
  9. MvdL79
    Member

    I have added it and know it finally works! :D
    Thanks!

    Posted 14 years ago #
  10. MvdL79
    Member

    One last thing;

    I am also limiting access to the redirect page, so you can only access it when you filling out the form and submitting it.

    For which I use the following code:

    <?php
    	session_start();
    	if($_SESSION['is_valid_user'] !== true){
    		die("You are not authorized to see this page");
    	}
    ?>

    It works great, however it breaks up my website's page layout.
    Anyway to post the "You are not authorized to see this page"-message WITHOUT breaking the page layout?

    Posted 14 years ago #
  11. MvdL79
    Member

    Sorry if I was not clear, but I want the message (You are not authorized to see this page) to be displayed in my current website's layout, without breaking it up.

    Currently it shows a white page with "You are not authorized to see this page" and nothing else. :(

    Posted 14 years ago #
  12. MvdL79
    Member

    * bump *

    Posted 14 years ago #
  13. yuniar

    This one is quite difficult to answer without seeing the whole code on your redirect page.

    However, here is one way to do it. Create another static page which contain the text "you are not authorized bla bla....".

    Let say you save it as unauthorized.php

    Then put this code into your redirect page:

    <?php
    	session_start();
    	if($_SESSION['is_valid_user'] !== true){
    		header("Location: unauthorized.php");
    		exit;
    	}
    ?>

    that should do it.


    MachForm Founder

    Posted 14 years ago #
  14. MvdL79
    Member

    Damn... Why couldn't I think of that.
    You really make me look stupid. ;)

    Thanks this will of course work without problems. Thank you very much!

    Posted 14 years ago #

RSS feed for this topic

Reply