title: File view to the another tab (PHP)
body: <p>I have inserted a file with an <strong>UPDATE</strong> command because I want my files (pdf, jpg) to be in one table together with name, course, etc. and and I just want to know if it it is possible that instead of showing the name of the filename in the table, its filename would be an <strong>href</strong> on when the person have click it, it would go in the another tab to show is content (pdf, or jpeg).</p>
  <p>Here is my code of my <strong>addrequirements.php</strong></p>
  <pre><code>&lt;?php
  include_once 'connection.php';
  $result = mysqli_query($conn,&quot;SELECT * FROM collegestud&quot;);
  $result1 = mysqli_query($conn,&quot;SELECT * FROM shsstud&quot;);
  session_start();
  if(!$_SESSION['login']){
      header(&quot;location:index.php&quot;);
      die;
  }
  ?&gt;
  &lt;div id=&quot;ccc&quot;&gt;
  &lt;?php
  if (mysqli_num_rows($result) &gt; 0) {
  ?&gt;
  &lt;table id=&quot;example&quot; class=&quot;display&quot; style=&quot;width:100%;&quot;&gt;
  &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;Student Id&lt;/th&gt;
          &lt;th&gt;Course&lt;/th&gt;
          &lt;th&gt;Last Name&lt;/th&gt;
          &lt;th&gt;First Name&lt;/th&gt;
      &lt;th&gt;Psa&lt;/th&gt;
      &lt;th&gt;Form137&lt;/th&gt;
      &lt;th&gt;2x2 Picture&lt;/th&gt;
          &lt;th&gt;Actions&lt;/th&gt;
        &lt;/tr&gt;
  &lt;/thead&gt;
      &lt;tbody id='cccc'&gt;
  &lt;?php
      $i=0;
      while($row = mysqli_fetch_array($result)) {
  ?&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $row[&quot;Stud_ID&quot;]; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $row[&quot;Course&quot;]; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $row[&quot;Lastname&quot;]; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;?php echo $row[&quot;Firstname&quot;]; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $row[&quot;PSA&quot;]; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $row[&quot;Form137&quot;]; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php echo $row[&quot;Picture&quot;]; ?&gt;&lt;/td&gt;
          &lt;td&gt;&lt;a style=&quot;color:green;&quot;  href=&quot;updatecollege1.php?id=&lt;?php echo $row[&quot;ID&quot;]; ?&gt;&quot;&gt;&lt;i class=&quot;fas fa-folder-plus fa-2x &quot;&gt;&lt;/i&gt;&lt;/a&gt;&amp;emsp;
      &lt;span&gt;&lt;a style=&quot;color:red&quot;  href=&quot;deletecollege.php?ID=&lt;?php echo $row[&quot;ID&quot;]; ?&gt;&quot;onclick=&quot;return confirm('Do you really want to delete this student?')&quot;&gt;&lt;i class=&quot;fas fa-user-minus fa-2x&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
  &lt;?php
          $i++;
      }
  ?&gt;
        &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;?php
  }
  else
  {
      echo &quot;&lt;p&gt;&lt;center&gt;&lt;strong&gt;0 RESULTS IN THE TABLE&lt;/center&gt;&lt;/p&gt;&lt;/strong&gt;&quot;;
  }
  ?&gt;
  </code></pre>
  <p>Code of my <strong>updatecollege1.php</strong></p>
  <pre><code>&lt;?php
  include_once 'connection.php';
  session_start();
  if(!$_SESSION['login']){
     header(&quot;location:index.php&quot;);
     die;
  }
  
  $result = mysqli_query($conn,&quot;SELECT * FROM collegestud WHERE id='&quot; . $_GET['id'] . &quot;'&quot;);
  $row= mysqli_fetch_array($result);
  ?&gt;
  
  &lt;div class = &quot;container3&quot;&gt;    
      &lt;strong&gt;&lt;left&gt;PSA&amp;emsp;&amp;emsp;&amp;emsp;&lt;/left&gt;&lt;/strong&gt;
  
      &lt;span&gt;&amp;emsp;&amp;emsp;&amp;emsp;&lt;input id=&quot;ra&quot; type=&quot;text&quot; value=&quot;&quot; readonly&gt;&lt;a href=&quot;psaadd.php?id=&lt;?php echo $row[&quot;ID&quot;]; ?&gt;&quot;&gt;ADD or UPDATE&lt;/a&gt;&lt;/span&gt;&lt;br&gt;
  </code></pre>
  <p>Code of my <strong>psaadd.php</strong></p>
  <pre><code>&lt;?php
  include_once 'connection.php';
  session_start();
  if(!$_SESSION['login']){
     header(&quot;location:index.php&quot;);
     die;
  }
  if(count($_POST)&gt;0) {
      mysqli_query($conn,&quot;UPDATE collegestud 
                              set PSA = '&quot; . $_POST['PSA'] .  &quot;'  
                          WHERE ID='&quot; . $_POST['ID'] . &quot;'&quot;);
      $id = $_POST['ID'];
      header('Location: updatecollege1.php?id='.$id);
  }
  $result = mysqli_query($conn,&quot;SELECT * FROM collegestud WHERE id='&quot; . $_GET['id'] . &quot;'&quot;);
  $row= mysqli_fetch_array($result);
  ?&gt;
  
  &lt;form action=&quot;&quot; method=&quot;POST&quot; onsubmit=&quot;return confirm('Are you sure you want to save changes?');&quot;&gt;
      &lt;div class= &quot;container2&quot;&gt;
          &lt;p style=&quot;font-weight: bold; font-size: 35px; text-align: center;&quot;&gt;PSA&lt;/p&gt;
              &lt;input type=&quot;hidden&quot; name=&quot;ID&quot; class=&quot;txtField&quot; value=&quot;&lt;?php echo $row['ID']; ?&gt;&quot;&gt;
              &lt;div class = &quot;container3&quot;&gt;
                  &lt;center&gt;
                      &lt;input name=&quot;PSA&quot; type = &quot;file&quot; accept = '.pdf'&gt;
                  &lt;/center&gt;
  </code></pre>
  <p><strong>PROBLEM:</strong></p>
  <p>I just want to have a solution that instead it displays the filename of that file (text), it will show its filename in the table that is clickable to open its file in the another tab.</p>