title: PHP $_GET Variable from previous page
body: <p>When the user clicks on a category it goes to <code>InsectsandPlants.php?pg=1</code> or the <code>?pg=whatevercategory</code>. Then on the next page I have a list of items, each one with a unique URL similar to: <code>view.php?aud=5</code> but the <code>?aud</code> changes for each item. So here's my <code>view.php</code> code:</p>
  
  <pre><code>&lt;?php
  
      $audint=$_GET['aud'];
      $result=mysql_query("SELECT * FROM insects WHERE inid=$audint");
  
      while($row=mysql_fetch_array($result))
      {
          $lru = $row['url'];
          $title = $row['title'];
  ?&gt;
  &lt;h3&gt;You Are Viewing &lt;?php echo $title; ?&gt;&lt;/br&gt;&lt;/br&gt;
  &lt;embed src="&lt;?php echo $lru; ?&gt;" autostart="true" loop="false" controller="true" bgcolor="#000" height="42" width="300"&gt;
  &lt;/br&gt;&lt;/br&gt;
  &lt;?php
      }
  ?&gt;
  </code></pre>
  
  <p>And the category page: </p>
  
  <pre><code>&lt;?php
  
      $pgint=$_GET['pg'];
  
      switch($pgint)
      {
          case "1":
              echo '&lt;li&gt;&lt;h4&gt;Insects and Plants&lt;/h4&gt;';
              $result=mysql_query("SELECT * FROM insects ORDER BY inid ASC");
          break;
          case "2":
              echo '&lt;li&gt;&lt;h4&gt;Dr. Seuss&lt;/h4&gt;';
              $result=mysql_query("SELECT * FROM DrSeuss ORDER BY inid ASC");
          break;
      }
  
      while($row=mysql_fetch_array($result))
      {
          array_reverse($row);
          $lru = $row['url'];
          $title = $row['title'];
          $id=$row['inid'];
      ?&gt;
  </code></pre>
  
  <p>It works for when <code>?pg=1</code> because that links to the <code>insects</code> SQL table. But I want to create a variable which changes depending on the previous page's <code>?pg=</code> number.</p>
  
  <p>Can anyone help with this?</p>