What code do i add in order to let logged in users to download pdf files or any attachments i would like them to download?
<?php
if (isset($_POST['login'])) {
$query = "SELECT * FROM users WHERE uuser='".$_POST['user']."' AND upass='".$_POST['pass']."'";
$result = mysql_query($query)
or die(mysql_error()."<br><b>error</b>: failed to execute query <i>$query</i>");
if ($myrow = mysql_fetch_array($result)) {
$_SESSION['web_user_id'] = $myrow['useqn'];
} else {
$err_msg = "<font color='red'>Invalid Login</font>";
} // end if
} // end if
if (isset($_GET['logoff'])) {
session_destroy();
} // end if
if ($_SESSION['web_user_id']) {
?>
<br><br><h2>Previous Orders
<p align='right'><a href='?page=Login&logoff' title=''>Log off</a></p></h2>
<?php
include "scripts/user/disp.php";
} else {
?>
<center>
<?php echo $err_msg;?>
<form method='post' action='?page=Login'>
<fieldset style='padding: 10px; text-align: left; width: 200px;'>
<legend>Login</legend>
<label>User Name</label><br />
<input type='text' name='user' /><br />
<label>Password</label><br />
<input type='password' name='pass' /><br />
</fieldset>
<br /><input type='submit' name='login' value='login' /> <input type='button' name='register' value='register' onclick="window.location='?page=Registration'" />
</form>
</center>
<?php
} // end if
?>