Hi all,
I am trying to password protect a .pdf document.
I have it working "pretty much" but rather than have a link that needs to be clicked after the name/pass is entered in the "Else..." statement, I have been trying to have the .pdf document open "automatically" without the link.
Code:
<?php
// Define your username and password
$username = "name";
$password = "pass";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
?>
//HTML Form resides here
<?php
}
else {
?>
//This is where I would like the document to
//"automatically" open.
<p><a href="doc.pdf">SURVEY</a></p>
<?php
}
?>
Thanks for your help and I am going to go and open my PHP book. I will post an answer if I get one.
Cheers,
Williwaw