How can a PHP script be executed on one server and the results displayed on a webpage hosted on a different server without using iframes?

To execute a PHP script on one server and display the results on a webpage hosted on a different server without using iframes, you can use cURL to make a request to the server running the PHP script and fetch the output. Then, you can display this output on the webpage hosted on the other server by simply echoing it out.

<?php
// URL of the server hosting the PHP script
$url = 'http://example.com/path/to/script.php';

// Initialize cURL session
$ch = curl_init($url);

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute cURL session and store the output
$output = curl_exec($ch);

// Close cURL session
curl_close($ch);

// Display the output on the webpage
echo $output;
?>