PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How to prevent others from accessing a download page with the URL copy paste

  1. suzannefiilipe
    Member

    Hi, I'm not a developer, but I use Gravity forms because it is simple. Love it.

    Can I force anyone to go back to the Form page if they try to share the redirect page URL with others that haven't fill out the initial form.

    Hope I'm being clear on what needs to happen,....
    Thank for your help,...

    Posted 12 years ago on Friday October 14, 2011 | Permalink
  2. You would have to do this via some customization to your theme or page template, it's not something Gravity Forms does itself. You would need to use PHP to check for a specific referrer ( in this case your form page ) and if that's not where they came from, then redirect them back to that page.

    You might be able to use a plugin like this one.. I haven't tried it for this scenario, but it looks like it may work.

    http://wordpress.org/extend/plugins/redirection/

    Posted 12 years ago on Friday October 14, 2011 | Permalink
  3. suzannefiilipe
    Member

    Thank you for the info, and quick reply. Very much appreciated.

    I tried the plug-in alone but didn't work.

    As I mentioned I am not a developer. I can create and apply custom page templates, and I can insert code no problem, but can't write a line of code. Do you have an idea of the code I would need to add in the custom page template to execute this function? If not I will understand. Thank you for the tip and quick reply.

    Posted 12 years ago on Saturday October 15, 2011 | Permalink
  4. Hi suzanne, you can add this bit of code to the page template that's being used for your redirect page. It will check to be sure they came from the form page, and if not, will direct them to the form page. You can copy the page template that's currently being used to serve your redirect page, and just add this code to the top, after the template name. Be sure to edit your page and select this new template.

    [php]
    $form_url = 'http://gravity.chrishajer.com/check-referer/';
    if (!($_SERVER['HTTP_REFERER']==$form_url)) {
        header("Location: $form_url");
        exit;
    }

    Change the "form_url" value to the URL where your form lives, the one you want people to be coming FROM before they can see the confirmation. The code says "if the HTTP_REFERER is not the form page, redirect them to the form page and exit."

    Try to access this page:
    http://gravity.chrishajer.com/hidden-thank-you-page/

    You will be redirected to this page:
    http://gravity.chrishajer.com/check-referer/

    If you submit the form there, you will be shown the confirmation page which is located here:
    http://gravity.chrishajer.com/hidden-thank-you-page/

    The HTTP_REFERER can be forged or modified by the browser, so this is not a super secure solution, but it will prevent direct access to the page by people who just share the URL.

    I also hid it in my list of pages, so it's not so obvious it's there.

    Posted 12 years ago on Sunday October 16, 2011 | Permalink