In this case, you can send your user a URL that consists of a PHP script rather than an HTML script as PHP runs on the server. Later it sends the output back to the user. You can use variables within your PHP script to create dynamic content.
Example:
Use this JavaScript on the front-end to request content from a PHP script. Later you can insert it into the current page.