dtc Posted May 7, 2006 Share Posted May 7, 2006 I run a site for a village (cornworthy_dot_com) that includes groups with their own pages on different servers. Currently I display their sites using frames so that we can include a home button. However, this is not entirely satisfactory and the ideal solution would be to display our fixed CSS menu at the top of the page. I have tried all sorts of way to do this using varieties of includes but all end up with the same result:-The page is included sucessfully, but associated files (e.g. CSS and backgrounds are not).I have searched the various FAQ's, groups etc for an answer to this (or a comment such as "dumbo it can't be done") but have not found a solution to what I thought would be a common problem - it is possible that being a newbie I didn't undersatnd the answers of couse.ThanksLofty Quote Link to comment Share on other sites More sharing options...
dtc Posted May 7, 2006 Author Share Posted May 7, 2006 Sorry - should have said - everything is running under Apache Quote Link to comment Share on other sites More sharing options...
Orio Posted May 7, 2006 Share Posted May 7, 2006 Can you post some code?I think you are having a problem because you use the <html>, <head> and <body> tags in your body tag.Like this:[code]<html><head><link rel="stylesheet" type="text/css" ...></head><body><!-- include the remote file --><?phpinclude("file.htm");?></body></html>[/code]The problem is that "file.htm" has it's own <html>, <head> and whatever tags, so you make something with no sense...But I cant be sure thats what happened, since you havent posted any code...Orio. Quote Link to comment Share on other sites More sharing options...
dtc Posted May 7, 2006 Author Share Posted May 7, 2006 Hi Orio - thanks for responding.Currently there are two html files plus the one that does the calling. I will remove two and retest - I have knocked up some code that represents th problem I have - cornworthy.com/pages/test1.php?http://www.hunterslodgeinn.co.ukcalls test2html which contains body and head tagscode is here[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><?PHP $mypath = "http://cornworthy.com/pages/test2.html";include $mypath;?> <?PHP $mypath = $_SERVER['argv'][0];echo "Cornworthy Village, Devon, England";include $mypath;?></body></html>[/code]I will let you know the result. Quote Link to comment Share on other sites More sharing options...
dtc Posted May 7, 2006 Author Share Posted May 7, 2006 Done that - removed header and body tags from both (saved as test3.php calling test4.html (with no head/body tags)).They are at the same url.Got the same resultLofty Quote Link to comment Share on other sites More sharing options...
dtc Posted May 8, 2006 Author Share Posted May 8, 2006 Done it - well almost, but it's a bit of a bodge to say the least.PHP calls Perl, which on our Apache is resident anyway.Perl mirrors the page - parses it as prints it and adds the target url before such things as CSS and images.If the browser clicks on a page in another directory it manages to add that to the url (we always start at the index page in the html_public root).The perl file is called with[code]<?php echo @stripslashes ( @join( @file( "http://cornworthy.com/cgi-bin/showurl" ),"\?http://cornworthy.com/imagelibrary/index.htm" ) ) ?>[/code]However you may noticed a problem here that I haven't got around yet. This is where I now need PHP help.The URL in the test was hard coded and I need to pass an argument (the target url) to perl as above. The '?' even when escaped is read by PHP and we get nothing. If I can get around that I have achieved what I need and only used HTML, PHP and Perl - completely and sucessfully avoiding C, C++, Forth, VB, Pascal, Cobol, Assembler, MASM, TASB, C#, .net, Fortran ........Help would be much appreciated - I'm pulling my hair out and I don't have much left as it is! Quote Link to comment Share on other sites More sharing options...
dtc Posted May 8, 2006 Author Share Posted May 8, 2006 OK done it - bearing in mind that this could be abused, I won't publish it here. If anyone is interested, please pm me stating your required use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.