By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,157 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

authenticating a user before opening a document by clicking a hyperlink

P: 14

I am new to PHP. I need to authenticate a user before clicking the link which opens an already existing PDF file.. so that no one can just click on a link provided to him/her and open the concerned PDF without providing the correct username and password first.

Can anyone help me with this authentication?
Dec 27 '07 #1
Share this Question
Share on Google+
1 Reply

P: 14
Hi again,

The issue is resolved now.. I tried the following:
// Code in Index.php

// HTML code
} else
echo 'Please Login First!!!' ;
include("Login.php"); // takes the user to the Login page for authentication
Only when the session is active can someone see the page Index.php... and at other times if someone just tries to copy-paste this page's URL in the address bar of some other window in order to open it, the control executes the code in the else part of the page thus prohibiting anyone from seeing the page without authentication!


I am only a week old with PHP and am expected to be good at it pretty quickly since there are many projects at my firm lined up.. most of them implement PHP. Would like to know of any books / websites that offer PHP tutorials and sample projects so that I can learn and code in PHP the proper way right from the beginning ...

Hope someone can help.. thanks in advance!!!
Dec 29 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.