title: showing alert box in php
body: <p>in the below code , the alert box is appearing in another window when values are not entered in the fields. but i want the alert box to appear in the same window of html page( detail.htm).how can i do this?</p>
  
  <p><strong>detail.htm:</strong></p>
  
  <pre><code>&lt;body&gt;    
      &lt;h1&gt; Product: &lt;/h1&gt;
      &lt;form  action="product.php"  method="post"  &gt;
          &lt;input type="text" name= "product_id" size="15" /&gt;
          &lt;input type="text" name= "price" size="10"/&gt;
          &lt;input type = "submit"  value = "enter" /&gt; 
      &lt;/form&gt;        
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>product.php:</strong></p>
  
  <pre><code>if (empty($_POST["product_id"]) || empty($_POST["price"])) {
      echo "&lt;script&gt;alert('You must enter both values.')&lt;/script&gt;";
  } else {
      include 'product.htm';
  }
  </code></pre>