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?

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'])) {
} // end if

if ($_SESSION['web_user_id']) {
<br><br><h2>Previous Orders
<p align='right'><a href='?page=Login&amp;logoff' title=''>Log off</a></p></h2>
   include "scripts/user/disp.php";
} else {
   <?php echo $err_msg;?>
   <form method='post' action='?page=Login'>
      <fieldset style='padding: 10px; text-align: left; width: 200px;'>


         <label>User Name</label><br />
         <input type='text' name='user' /><br />
         <label>Password</label><br />
         <input type='password' name='pass' /><br />
      <br /><input type='submit' name='login' value='login' /> <input type='button' name='register' value='register' onclick="window.location='?page=Registration'" />
} // end if

If they have logged in you could create a session that says that the user is logged in, and then on the other page, if the session exists, you could show the download links?

Of course this is just a simple suggestion, I have yet to mention security etc. ;)

The problem is I am new to this and this is not my coding. It is another developers work.

Is there no piece of code to add to indicate a link in the current code i posted earlier?


while starting session


and on download page, you can check

 do some download work
     links to downloadable pdf



COuld someone please show me where to insert your guys code in the code I provided...

I am new to this and this is the previous web masters files I am working with...