开发者

opening a web page in php

I want to open "product.htm" page if the product id value is not empty. I don't know how to do this. I am not finding the solution for this. Any help would be highly appreciated.

product.php:

<?php

 if ( empty($_POST["product_id"]) || empty($_POST["price"]) )
         { 
         echo (" you must enter the values for both fields ");
         }
  else
         {
        // here i want to ope开发者_如何学Cn product.htm if product id and price both are given         
         } 
?>


By "Open" you could mean include('product.htm') or Header: Location('product.htm') But i'm assuming one of these will be useful for you


You could just require the page contents, or echo some javascript that will open a popup if thats what you want.

To show product.html in the current page:

require 'product.html';

To open it in a popup:

?>

<script type='text/javascript'>
 window.open('product.html');
</script>

<?php


You might be looking for the include() PHP function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜