Not picking up associated files with include (url)
Posted 07 May 2006 - 03:15 PM
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.
Posted 07 May 2006 - 04:20 PM
Posted 07 May 2006 - 06:47 PM
I think you are having a problem because you use the <html>, <head> and <body> tags in your body tag.
<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...
(Gone until 20 to November)
Posted 07 May 2006 - 09:46 PM
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']; echo "Cornworthy Village, Devon, England"; include $mypath; ?> </body> </html>I will let you know the result.
Posted 07 May 2006 - 09:57 PM
They are at the same url.
Got the same result
Posted 08 May 2006 - 01:51 PM
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!
Posted 08 May 2006 - 10:14 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users