Home »
Web
»
Web Site Management
Read the article that everyone's commenting on.
Subscribe to the RSS Feed for comments on this article.
Well, running it from Telnet (if I'm even doing it correctly) yields the following error message:
No such file or directory
...as if it's looking for a file named proxy.pl?http://www.comptonmfg.com/page1.txt rather than actually going to the address in the query string.
I've adjusted the path to perl to a later version of perl. No help there. I'm an HTML guru, not a perl guru, so I am admittedly ignorant of a lot of this. How do I test getprint?
Also, I'm wondering if as small as this script is, it might not be overkill for my needs. What I mean is, if everyone who I want to use this script is going to be referencing the same page, is there an even simpler way; for example, embedding the actual URL in the proxy.pl script. That may be what we've achieved with the extra line of code, in which case we still have a getprint issue, but I thought it worth mentioning. The bottom line is if people will need to install the script anyway, and if the only thing I want them pulling data from is a pre-determined text file, is there a way to do that and bypass the query string altogether?
Posted by: Joe Formtester at December 18, 2005 8:48 PMForm the command line you have to specify the parameter using environment variables (set QUERY_STRING) and so on.
But yes, hard code a URL into the perl script instead of attempting to use the parameter and see if you can get that working.
Posted by: Leo at December 18, 2005 9:05 PMHere is how I'm hard coding the URL into the script:
#!/usr/bin/perl5.00405
use LWP::Simple;
print "Content-type:text/html\n\n";
getprint (http://www.comptonmfg.com/page1.txt);
And I'm referencing it like this in the shtml page file:
<!--#include VIRTUAL="/cgi-bin/proxy.pl" -->
and it returns an error. Is this correct or am I missing something?
Posted by: Joe Formtester at December 18, 2005 9:40 PMHey, it looks like I got it to work with this:
#!/usr/bin/perl
use LWP::Simple;
print "Content-type:text/html\n\n";
print get("http://www.comptonmfg.com/page1.txt");
Does that make sense? There's no getprint involved. I was just goofing around and, poof, it worked. Second question: If this DOES make sense, should that same script work with other Apache configurations (I'm assuming that people with ASP and PHP will be able to simply pull in the content from my page with just the appropriate include, skipping the script)?
Posted by: Joe Formtester at December 18, 2005 10:06 PMand again
obviously no tags allowed
#include VIRTUAL="/cgi-bin/GetRemote.pl?http://www.colosoccer.com.au/pentire.html"
Try using CSS and putting images as backgrounds to
Shraddhan,
If you're following the guidelines listed in this article, then technically everything should be ok. I was just fiddling around with this, and had some issues getting the includes to display properly. But by simply renaming my file from curious.html to curious.asp, the include then worked flawlessly. The include didn't care what the file extension was (html, asp, dat etc) for the file I used to hold the included data, it simply took what was in the included file and flowed it into the .asp file.
As an overview, I used 2 files:
- curious.asp
- content.dat
curious.asp holds:
<html>
<head>
<title>include test</title>
</head>
<body bgcolor= "#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<!--#include FILE="content.dat" -->
</body>
</html>
content.dat holds:
<table width=764 BORDER=0 CELLSPACING=0 CELLPADDING=0>
<tr valign=top>
<td align=left valign=top>
Stuff I wanna say and images I want to include etc.
</td>
</tr>
</table>
A stumbling block that could be messing things up for you is: is the server that's hosting your files .asp compatible? if it's not, then your includes will not work. (using the format of: <!--#include FILE="content.dat" --> ). Hope that helps you out. To my knowledge, the framesets should not be causing a problem.
Posted by: qixsilver at May 26, 2006 1:11 PMHi All,
Well i read all the solutions provided but i could'nt find any solution to my problem. i have two html files ie index.html and menu.html , i want to include the menu.html in my index.html. i used <!-- #include FILE="menu.html --> but its not working.. please provide me the better solution
regards
Naseer
a) you have a space between the "-" and the "#" - that's enough to have it fail.
b) the server must be configured to support SSI. You should check.
Posted by: Leo at May 31, 2006 10:48 PMi can't ge this to work. i am using apache, i admit fairly new with apache, but i have followed the steps numerous times to use SSI on apache, and everytime, it just completely ignores my include statement. using the correct context also.
Posted by: skimaster18 at June 11, 2006 10:41 AMTo post a comment on "How do I include one HTML file inside another?", please return to that article's main page.