I have two php pages. I want to fetch b.php in a.php.
In my a.php:
$ch = curl_init(\"b.php\"); echo(curl_exec($ch)); curl_close($ch);
How about taking the domain from HTTP_HOST?
$domain = $_SERVER['HTTP_HOST']; $prefix = $_SERVER['HTTPS'] ? 'https://' : 'http://'; $relative = '/b.php'; $ch = curl_init($prefix.$domain.$relative); echo(curl_exec($ch)); curl_close($ch);