I want to display a PHP file for my other website page, but I am facing a problem.
Can you please tell me how I can put 2 times this code in my page?
I'll put one time code in my site then it's working fine but if put it there a 2nd time then website is not responding
<?php
$myurl = "http://domain.com/diplay.php";
function get_http_response_code($myurl) {
$headers = get_headers($myurl);
return substr($headers[0], 9, 3);
}
if(get_http_response_code($myurl) != "200"){
echo "error";
}else{
echo file_get_contents($myurl);
}
?>
<?php
$myurl1 = "http://domain1.com/diplay.php";
function get_http_response_code($myurl1) {
$headers = get_headers($myurl1);
return substr($headers[0], 9, 3);
}
if(get_http_response_code($myurl1) != "200"){
echo "error";
}else{
echo file_get_contents($myurl1);
}
?>