user2530184
user2530184

Reputation: 17

a page in a page without iframe

I am trying to find a way how to put a page in another page without iframe and inculde the header and footer.I have try iframe but i didn't like it.This is what the layout would look like, i made a page call help.php in this file i include the follow code below

<?php include("connection.php"); include("header.php"); ?>
  <div class="container">
( i want to put this url here support.sitename.com )
</div>
<?php include("footer.php") ?> 

it should be like this sitename.com/help.php i have another page support.sitename.com ( this one is using a help desk software call HESK

i am trying to add support.sitename.com into sitename.com/help.php but i don't want to use iframe how can i do this

Upvotes: 1

Views: 636

Answers (1)

Pedro Lobito
Pedro Lobito

Reputation: 98921

<?php include("connection.php"); include("header.php"); ?>
  <div class="container">
<?php 
$html =  file_get_contents("http://support.sitename.com"); 
$html = preg_replace('%href="/(.*?)"%si', 'href="http://support.sitename.com/$1"', $html);
echo $html;
?>
</div>
<?php include("footer.php") ?> 

Upvotes: 1

Related Questions