title: php print preview for form only
body: <p>I am a newbie in php code and I have been create a print button but it show the content of whole page.I want to create a print preview that just print for the content of form. So how I need to do, someone help me please....and here is my code.</p>
  
  <p><strong>reserve.php</strong></p>
  
  <pre><code>&lt;?php include('header_user.php');?&gt;
  &lt;div id="container"&gt;
  &lt;div id="content"&gt;
  &lt;div id="contentleft"&gt;
  &lt;div class="reserve-form"&gt;
      &lt;h1&gt;Make Reserve&lt;/h1&gt;
  &lt;form action="reservation.inc.php" method="POST"&gt;
      &lt;!--username--&gt;
      &lt;label for="uname"&gt;&lt;b&gt;Username&lt;/b&gt;&lt;/label&gt;
      &lt;input type="text" name="uid" placeholder="Your username" required=""&gt;
      &lt;!--username--&gt;
      &lt;/br&gt;
      &lt;!--person--&gt;
      &lt;label for="hperson"&gt;&lt;b&gt;Person&lt;/b&gt;&lt;/label&gt;
      &lt;select id="person" name="person"&gt;
          &lt;option selected hidden&gt;How many person?&lt;/option&gt;
          &lt;option value="1 Person"&gt;1 Person&lt;/option&gt;
          &lt;option value="2 Person"&gt;2 Person&lt;/option&gt;
          &lt;option value="3 Person"&gt;3 Person&lt;/option&gt;
          &lt;option value="4 Person"&gt;4 Person&lt;/option&gt;
          &lt;option value="5 Person"&gt;5 Person&lt;/option&gt;
      &lt;/select&gt;
      &lt;!--person--&gt;
      &lt;/br&gt;
      &lt;!--date--&gt;
      &lt;label for="wdate"&gt;&lt;b&gt;Date&lt;/b&gt;&lt;/label&gt;
      &lt;input type="text" name="bookdate" placeholder="dd-MM-yy" required=""&gt;
      &lt;!--date--&gt;
      &lt;/br&gt;
      &lt;!--time--&gt;
      &lt;label for="wtime"&gt;&lt;b&gt;Time&lt;/b&gt;&lt;/label&gt;
      &lt;input type="text" name="booktime" placeholder="0.00pm" required=""&gt;
      &lt;!--time--&gt;
      &lt;/br&gt;
      &lt;!--Select Table--&gt;
      &lt;label for="rtable"&gt;&lt;b&gt;Table No&lt;/b&gt;&lt;/label&gt;
      &lt;select id="table" name="booktable"&gt;
          &lt;option selected hidden&gt;Choose your table&lt;/option&gt;
          &lt;option value="T1"&gt;T1&lt;/option&gt;
          &lt;option value="T2"&gt;T2&lt;/option&gt;
          &lt;option value="T3"&gt;T3&lt;/option&gt;
          &lt;option value="T4"&gt;T4&lt;/option&gt;
          &lt;option value="T5"&gt;T5&lt;/option&gt;
      &lt;/select&gt;
      &lt;!--end select--&gt;
      &lt;button type="submit" name="confirm" class="loginbtn"&gt;Confirm&lt;/button&gt;
      &lt;a class="print_btn" href="" onclick="window.print();"&gt;Print&lt;/a&gt;
  &lt;/form&gt; 
  &lt;/div&gt;
  &lt;/div&gt;&lt;!--contentleft--&gt;
  &lt;?php include('sidebar.php');?&gt;
  &lt;/div&gt;&lt;!--content--&gt;
  &lt;/div&gt;&lt;!--container--&gt;
  &lt;?php include('footer_user.php');?&gt;
  </code></pre>