Author Topic: PHP Include()  (Read 240 times)

vicioso

  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
PHP Include()
« on: September 03, 2010, 02:56:59 PM »
Thank you in Advance. 
 
I need help; I am working on a personal website that is currently working.  Recently, I build a second website that also works.  The second website only has a topnavigation and a image slider in the body.
 
What I'm trying to do is to insert the second website inside the first one. I tried using an include() function which work halfway but it doensn't load my images and style.css that is located in separate folders.  I need to know if there is a better way of doing this.
 
Basically I want to grab the first website and insert the functinality of the otherone in it.
 
For example:
1st website has a naviation bar, text and footer.
2nd website has a image that changes every few second.
 
How can I combine both?  I don't want to move the code from one site to the other because it might become messy.
 
please help. 
 
R.
 
 
 
 
 
 

123z

  • New Member
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: PHP Include()
« Reply #1 on: September 03, 2010, 10:07:30 PM »
Since your first site has most of the things.. I'd grab the images from the second.. the way I did it was..

making include.php
then in that create a here document.. like so.

PHP Code: [Select]

$insertHTML 
= <<<anyname 
<html>
<
head></head>
<
body>
</
body>
</
html>
anyname


insert the html for the images.. then go to teh page you want that piece inserted..
<?php echo $insertHTML ?>

Hope that's what you wanted..