Executing a PHP file in a Modal Popup

Executing a PHP file in a Modal Popup

I currently use a very small simple javascript popup function that passes parameters to a PHP file and opens that PHP file (ShowTheReviews.php) in a popup window to display reviews of a product. It works perfectly on desktops, but is not responsive, and not mobile friendly and opens a new window/tab on tablets and smart phones.

Looking for a replacement that does a Model popup that overlays on the current page. Can anyone suggest a way to modify (using Javascript or JQuery) this popup function to display  the PHP file (ShowTheReview.php) contents into a Modal Responsive popup, that could be substituted for the openpopup function I now use?

My current call to the old javascript function openpopup is:

  1.     <a href="javascript:openpopup('www.mysite.com/php/ShowTheReviews.php?Productnum=XXXXXX&MODEL=Product%20Name')">Click for Reviews</a>


The file ShowTheReview.php, parses out the variables sent, and inserts them in the title above the reviews, and inserts the ProductNum into an external URL to retrieve reviews. I used this PHP file to parse the variables.

Here is the javascript that is placed in the header for this old function:

  1.     <script type="text/javascript">
  2.     //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com)
  3.     //Visit JavaScriptKit.com for free JavaScripts
  4.     //This notice must stay intact for legal use
  5.     function openpopup(popurl){
  6.     var winpops=window.open(popurl,"","width=730,height=720,status,scrollbars,resizable")
  7.     }
  8.     </script>