title: open files(pdf,word,excel) in php(mysql database is used)
body: <p>i am new to php and mysql.i have created a php page for uploading files and these files are saved to my local drive.In another page when a user selects a option files relating to the option are displayed in table format.one column will be link to the file in local drive.upto here i was successful.
  Problem is that when clicking on the file hyperlink nothing is displayed.but when i copy address link of the file and paste in new window it is opening.please help me I am stuck for 2 weeks with problem.
  To experiment I Have created simple php file just to see the hyperlink working.but no success.I will paste here the trails i have used</p>
  
  <pre><code>&lt;?php echo "&lt;a href=`file:///C|/Inetpub/wwwroot/help.gif' &gt;hi&lt;/a&gt;";?&gt;-----not worked
  &lt;?php echo "&lt;a href=http://www.google.com&gt;hi&lt;/a&gt;";?&gt; ------ working.
  </code></pre>
  
  <p>even " "  tags are not working if files are saved as php file.....i am using ISp server.my php files are saved in "C:\Inetpub\wwwroot\phpsample" path
  please help me find solution</p>
  
  <p>----my original code----
         
      </p>
  
  <pre><code>&lt;form  action="http://localhost/phpsample/upload/upload2.php" method='post'enctype='multipart/form-data'&gt;
  Instrument:&lt;select name="flist"&gt;
    &lt;option&gt;select&lt;/option&gt; 
    &lt;option&gt;gt1&lt;/option&gt;
    &lt;option&gt;gt2&lt;/option&gt;
    &lt;option&gt;gt3&lt;/option&gt;
    &lt;option&gt;gt4&lt;/option&gt;
  &lt;/select&gt;
  &lt;/br&gt;
  Date: &lt;input type="date" name="fdate" /&gt;&lt;/br&gt;
  &lt;label for="file"&gt;Filename:&lt;/label&gt;
  &lt;input type="file" name="file" id="file" /&gt; 
  &lt;br /&gt;
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  &lt;?php
  
  
  global $dest;
  global $name;
  
  $dest='E:\divya';
  $name=$_FILES["file"]["name"];
  echo $dest;
  
  move_uploaded_file($_FILES["file"]["tmp_name"],"$dest/$name");
  
  $con = mysql_connect("localhost","root","");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("upload_db", $con);
  
  mysql_query("INSERT INTO upload_tb (Instrument, date_upload, filename)
  VALUES('$_POST[flist]','$_POST[fdate]','$name')");
  mysql_close($con);
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>----my original code to download file from table----
      
      </p>
  
  <pre><code>&lt;form  action="http://localhost/phpsample/display/display.php" method='post'enctype='multipart/form-data'&gt;
  Instrument:
    &lt;select name="flist"&gt;
      &lt;option&gt;select&lt;/option&gt;
      &lt;option&gt;gt1&lt;/option&gt;
      &lt;option&gt;gt2&lt;/option&gt;
      &lt;option&gt;gt3&lt;/option&gt;
      &lt;option&gt;gt4&lt;/option&gt;
    &lt;/select&gt;
  &lt;/br&gt;
  Date: 
  &lt;input type="date" name="fdate" /&gt;&lt;/br&gt;
  
  &lt;input type="submit" /&gt;
  &lt;/form&gt;
  &lt;?php
  
  echo $_POST['fdate'];
  echo $_POST['flist'];
  
  $path='file:\\\C:\\Inetpub\\wwwroot\\phpsample\\display\\NewTextDocument.txt';
  
  
  $con = mysql_connect("localhost","root","");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("upload_db", $con);
  
  
  $result = mysql_query("SELECT * FROM upload_tb  WHERE Instrument='$_POST[flist]'");
  echo "&lt;table border='1'&gt;
  &lt;tr&gt;
  &lt;th&gt;Slno&lt;/th&gt;
  &lt;th&gt;Name&lt;/th&gt;
  &lt;th&gt;comment&lt;/th&gt;
  &lt;/tr&gt;";
  fopen("c:\Inetpub\wwwroot\phpsample\display\NewTextDocument.txt","r");
  while($row = mysql_fetch_array($result))
    {
      $filename=$row['filename'];
  echo $filename;
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['Instrument'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['date_upload'] . "&lt;/td&gt;";
    echo "&lt;td&gt;"."&lt;a href= $path&gt;". $row['filename'] ."&lt;/a&gt;"."&lt;/td&gt;";
  
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/table&gt;";
  
  mysql_close($con);
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>