Appnitro Software Forums » MachForm 2

Avoiding form bypass


  1. nycvelo
    Member

    Greetings, and apologies if this has already been asked and answered.

    This may be more an Apache question than Machform, but is there a recommended practice, when using Machform and page redirects, to ensure that site visitors *must* use the form first and cannot go directly to the redirect page?

    For example, if I embed the Machform iframe in "index.html" and then redirect to "index1.html", it is still possible to go directly to "index1.html" and avoid filling out the form. How to prevent that behavior?

    Posted 2 years ago #
  2. redityo

    Hi,

    You can use a session variable to validate a user before go to redirect page, but you need to use "PHP" file rather that "HTML". For example I assume you've this pages :

    - index.html or index.php, where you put the form
    - index1.php is redirected page

    Then you need to edit "includes/post-functions.php" file and go to line 1170 to search this line :

    $process_result['status'] = true;

    exactly under that line add this

    $_SESSION['is_valid_user'] = true;

    and now to check the user on redirect page, simply add these code in the first line of "index1.php" file

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

    MachForm Support

    Posted 2 years ago #
  3. nycvelo
    Member

    Thanks. Besides renaming index1.html to index1.php and adding the php code above, do I need to do anything else to get this working? (PHP already works with Apache)

    thanks again

    Posted 2 years ago #
  4. I believe that's all you need to make it work. No need to reconfigure PHP or Apache or anything.


    MachForm Founder

    Posted 2 years ago #

RSS feed for this topic

Reply