Jump to content


Photo

Not picking up associated files with include (url)


  • Please log in to reply
6 replies to this topic

#1 dtc

dtc
  • New Members
  • Pip
  • Newbie
  • 7 posts
  • LocationDevon, England

Posted 07 May 2006 - 03:15 PM

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.
Thanks
Lofty

#2 dtc

dtc
  • New Members
  • Pip
  • Newbie
  • 7 posts
  • LocationDevon, England

Posted 07 May 2006 - 04:20 PM

Sorry - should have said - everything is running under Apache

#3 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 07 May 2006 - 06:47 PM

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:
<html>
<head>
<link rel="stylesheet" type="text/css" ...>
</head>
<body>
<!-- include the remote file -->
<?php
include("file.htm");
?>
</body>
</html>

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.
Think you're smarty?

(Gone until 20 to November)

#4 dtc

dtc
  • New Members
  • Pip
  • Newbie
  • 7 posts
  • LocationDevon, England

Posted 07 May 2006 - 09:46 PM

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.uk
calls test2html which contains body and head tags
code is here
<!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>
I will let you know the result.

#5 dtc

dtc
  • New Members
  • Pip
  • Newbie
  • 7 posts
  • LocationDevon, England

Posted 07 May 2006 - 09:57 PM

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 result
Lofty


#6 dtc

dtc
  • New Members
  • Pip
  • Newbie
  • 7 posts
  • LocationDevon, England

Posted 08 May 2006 - 01:51 PM

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
<?php echo @stripslashes ( @join( @file( "http://cornworthy.com/cgi-bin/showurl" ),"\?http://cornworthy.com/imagelibrary/index.htm" ) ) ?>
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!



#7 dtc

dtc
  • New Members
  • Pip
  • Newbie
  • 7 posts
  • LocationDevon, England

Posted 08 May 2006 - 10:14 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users