Forum Moderators: coopster
folder1
-index.php
folder2
-styles.css
-index.php
Here is folder1's index.php:
<?php
$file_to_include='./folder2/index.php'
include $file_to_include;
?>
Here is folder2's index.php:
<?php
include 'styles.css';
<div class=divs>Some Text</div>
?>
The problem is that when you run folder1's index.php, the styles in the included file don't work (loading folder2's index.php from folder1's index.php makes folder2's index.php load the css file from folder1).
And I'm assuming I can't change the contents of folder2.
Thank you,
Jacob
// Assuming that http://example.com/folder2/index.php is valid:
include( $_SERVER['DOCUMENT_ROOT']. '/folder2/index.php' );
Though, I'm not sure why you are including your stylesheet file with php into the document instead of just calling the external stylesheet with something like this in the <head> of each page:
<link href="http://example.com/folder2/styles.css" rel="stylesheet" type="text/css" />
[us3.php.net...]
[us3.php.net...]
You'll probably be able to sort it out with those. Assumptions aside, editing the files would be much simpler. ;)
I need some command that will add the other website path to every href in the other website.
[edited by: Jacob_or_JaF at 8:15 pm (utc) on Sep. 6, 2006]
1. <iframe src="http://someoneelsessite.com/somepage.html" style="width: 600px; height: 400px;"></iframe>
2. file_get_contents [php.net], then preg_replace [php.net] every relative path to add the http:/someoneelsessite.com/. I don't have any regular expression handy that would do what you want, but I know it's possible.
iframe is easy for just displaying another site in your site, but I'm not sure if it will meet your needs. (I'm afraid I'm still a bit unsure about what the end goal is here.)
Why would you want to include someone else's website within your own page? Why not just link to the site and pop it open in a new window or something?