I use the plugin to protect online files within

I use the plugin to protect online files within the protected area. Each page is a project and for every project I mail de customer the link to the file with the pasword. Many custumaers are lazy and not technical. So it would be great if the link in the url could have the passward integrated; that way they don't get the field to enter the password.
Because the mail can be send forward to other persons who trough the customer; I can not make a userbased acces.
Not the hole page is protected so that I can use the rest for all public as port folio without having to make a second extra page for that; simpel and everything in one; thats the goal idea.
So the question is or the password from the plugin can be integrated in the url to the page.
It would be great but I understand that this is possible not possible.

  • Ash

    Hello there

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    I think this is pretty much possible. You need to edit some code.

    Suppose, your post url is: http://my-site.com/my-post/
    The password in this post is ppwd.
    So make the url like http://my-site.com/my-post/?pw=ppwd
    Now add the following code in your footer.php

    <?php if(isset($_REQUEST['pw']) && $_REQUEST['pw'] == 'ppwd') { ?>
    <script type="text/javascript">
    	jQuery(function($){
    		$('input[name=post_password]').val('<?php echo $_REQUEST['pw'] ?>').parent().next().click();
    	});
    </script>
    <?php } ?>

    It should work :slight_smile:

    Please let me know if it is helpful and feel free to ask more question if you have.

    Cheers
    Ash

  • Eelco

    Thanks! It's helpfull!

    A detail; I readed this answer in the mail; then the code is shown as:
    Now add the following code in your footer.php
    <?php if(isset($_REQUEST['pw']) && $_REQUEST['pw'] == 'ppwd':wink: { ?>
    <script type="text/javascript">
    jQuery(function($){
    $('input[name=post_password]':wink:.val('<?php echo $_REQUEST['pw'] ?>':wink:.parent().next().click();
    });
    </script>
    <?php } ?>
    It should work

    That did not work of course; so later on I came to the idea to open the original post :wink:.

    Now I have to get an solution for the fact that everytme the password is different per page. I will look to that by myself; maybe I search for a plugin to plugin the php in the page itself.

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.