Mobile app version of vmapp.org
Login or Join
Sherry384

: Login script with member area/user Is there a free script which I can use to: Share some PDF with my partners. But i need the user to reach only those PDFs which they have privileges for.

@Sherry384

Posted in: #Authentication #LookingForAScript #Mysql #Php

Is there a free script which I can use to:

Share some PDF with my partners. But i need the user to reach only those PDFs which they have privileges for. So I need:


login script with registration (i will make the registration if need. So registration function will public)
every user should have their own member area
I will upload PDFs to the specified user areas
when my partners sign in they can see only those PDFs that they have privileges for

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry384

2 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

UserCake is an open source PHP user management script which has registration features and user group features which you could use to manage who has access to which PDF files.
usercake.com/

10% popularity Vote Up Vote Down


 

@BetL925

I would recommend using Google Docs for this.

In broad strokes:
If you insist on creating this feature yourself, you would need to store your user info (user ID, Password, etc) in a table in a database.
Then you'd need a second table which has the info on the PDF files (link, name, which user ID's have access to it).
When a user logs in you would run a query to authenticate them with their user ID and password from the users table, and checks at the same time which PDF files are accessible to that user.

Your login form would look something like this:

<form name="login" action="login.php" method="post">
User ID: <input type="text" name="user" /><br />
Password: <input type="text" name="pass" /><br />
<input type="submit" value="Sign In" />
</form>


Your login.php file would have something like this:

<?php
$query = mysql_query("SELECT userID, password FROM users_table WHERE userID = '$_POST['user']'");
$get_user = mysql_fetch_array($query);
if ($get_user['password_column'] == $_POST['pass']){
//user is logged in!
}
else {
//invalid username or password
}
?>


Your PDF file info table would have to have at the least the PDF file name and which users are allowed to view/download that file. Once the user is logged in you would run a query which looks something like this (assuming you have the user name stored in the PHP variable $user:

SELECT * FROM pdf_table WHERE MATCH(allowed_users_column) AGAINST ('$user')


So to make a long story short: it is very possible to do this. The code I've posted is rudimentary and basic at best, but it should give you a general idea of how to accomplish this if you cannot use a service like Google Docs for this.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme