|   |   |   | ||||
| Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. | 
|    | 
| 
 | |||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
|  | Thread Tools | 
|  10-14-2006, 04:56 AM | #1 | 
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | 
				
				looking for help with php include please
			 What do I need to do to get the following code to work on pages that do not have the .php extension..  seems it only works when the page is pagename.php, but I need it to work on .shtml, .htm & .html, etc... what can I do? PHP Code: 
			 | 
|   |           | 
|  10-14-2006, 05:16 AM | #2 | 
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | bump.. please help | 
|   |           | 
|  10-14-2006, 05:20 AM | #3 | 
| Confirmed User Join Date: Sep 2003 
					Posts: 8,713
				 | <!--#include file="filename.what ever" --> 
				__________________  TrafficCashGold Paying Webmasters Since 1996! Awesome Conversions! Fast Weekly Payments! Over 125 Tours! | 
|   |           | 
|  10-14-2006, 05:23 AM | #4 | 
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | |
|   |           | 
|  10-14-2006, 05:53 AM | #5 | ||
| Confirmed User Join Date: Jun 2006 Location: Finland 
					Posts: 279
				 | Quote: 
 This one has always worked for me: PHP Code: 
			
				__________________ Quote: 
 | ||
|   |           | 
|  10-14-2006, 05:57 AM | #6 | 
| Too lazy to set a custom title Industry Role:  Join Date: Aug 2002 
					Posts: 55,372
				 | .htaccess AddType text/html .shtml .html .inc AddHandler server-parsed .shtml .html .inc or if you want html files to be treated as php add this RemoveHandler .html .htm AddType application/x-httpd-php .html .htm 
				__________________ Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.  WP Stuff | 
|   |           | 
|  10-14-2006, 04:28 PM | #7 | 
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | ok..the htaccess thing, I'm lost.. might as well be chinese, don't make sense to me..   the file is .htm, but I can name it .php, whatever, is just a page.. but need to be able to include it externally on other pages, like jaymancash's potd blog plugin, how you use the php include code to get the table to appear on our pages, I'd like to provide the php include code to give to others to have my table show up on their page. I don't want an Iframe or javascript, it has to be php include | 
|   |           | 
|  10-14-2006, 04:32 PM | #8 | 
| Now choke yourself! Industry Role:  Join Date: Apr 2006 
					Posts: 12,085
				 | You have to do what Fris said. What that will do (create a file named .htaccess in your index root), and put the content in it, will have it parse all of the listed files as though they were native PHP. Other hacks are more ineligant - however, this will slow you down a bit for static content, not that you'll really notice. You also don't want to do a PHP include across sites, that allows for cross-scripting. If you want them to force inline, that's one of the few choices, but it's incredibly retarded. See above reasoning. 
				__________________ | 
|   |           | 
|  10-14-2006, 04:35 PM | #9 | |
| Confirmed User Join Date: Jul 2006 Location: Philadelphia 
					Posts: 1,282
				 | put this in your htaccess file if you wanted to parse html as php do this (though you shouldnt do this) in .htaccess file Quote: 
 PHP Code: 
			 | |
|   |           | 
|  10-14-2006, 04:36 PM | #10 | |
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | Quote: 
 | |
|   |           | 
|  10-14-2006, 04:39 PM | #11 | 
| Confirmed User Join Date: Jul 2006 Location: Philadelphia 
					Posts: 1,282
				 | Produce an XML file and build a script to parse and display it on external hosts. You dont use include for external stuff.. | 
|   |           | 
|  10-14-2006, 04:42 PM | #12 | |
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | Quote: 
 It is a php include., with a full url this is what I am trying to do, but it's not working on any pages that do not have .php as the extension | |
|   |           | 
|  10-14-2006, 04:44 PM | #13 | |
| Now choke yourself! Industry Role:  Join Date: Apr 2006 
					Posts: 12,085
				 | Quote: 
 If you have to have something work externally with URL wrappers, at least look into readfile.. that won't execute code unless you explicitly eval() it. 
				__________________ | |
|   |           | 
|  10-14-2006, 04:46 PM | #14 | 
| Confirmed User Join Date: Jul 2006 Location: Philadelphia 
					Posts: 1,282
				 | |
|   |           | 
|  10-14-2006, 04:54 PM | #15 | 
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | |
|   |           | 
|  10-14-2006, 04:59 PM | #16 | 
| Confirmed User Join Date: Mar 2004 Location: New Orleans, LA 
					Posts: 1,001
				 | try using fread() 
				__________________ PHP Programmer ICQ 215-504-788 | 
|   |           | 
|  10-14-2006, 05:01 PM | #17 | 
| Confirmed User Join Date: Jul 2006 Location: Philadelphia 
					Posts: 1,282
				 | Well i dont think theyre using include then if it works in html files. whatever. Its your shit | 
|   |           | 
|  10-14-2006, 05:16 PM | #18 | 
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | |
|   |           | 
|  10-14-2006, 11:49 PM | #19 | 
| Totally Borked Industry Role:  Join Date: Feb 2005 
					Posts: 6,284
				 | check to make sure URL fopen is enabled on your PHP server, then do what Fris said to have all the local files served as php files. 
				__________________  For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 | 
|   |           | 
|  10-14-2006, 11:54 PM | #20 | 
| Totally Borked Industry Role:  Join Date: Feb 2005 
					Posts: 6,284
				 | that said, you clients also have to have it enabled.  Have a look at Apache SSI If you're going to allow remote includes, make sure you configure Apache to disable HTTP PUT methods etc. Otherwise, you could be opening up a big secruity hole for well-crafted remote code to overwrite your files etc. Sure you can allow remote includes, but if you haven't secured the installation, you could be enabling remote writing at the same time. 
				__________________  For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 | 
|   |           | 
|  10-15-2006, 12:17 AM | #21 | |
| Now choke yourself! Industry Role:  Join Date: Apr 2006 
					Posts: 12,085
				 | Quote: 
 
				__________________ | |
|   |           | 
|  10-15-2006, 04:51 AM | #23 | 
| Confirmed User Join Date: Jul 2006 Location: Philadelphia 
					Posts: 1,282
				 | why not do it the right way. Does this POTD change once a day? Why would you include something (have your server connect to a remote host for every single page load) that changes only once a day. fucking christ put 30 ravin riley pictures in a directory and cycle them at random. same dumb effect | 
|   |           | 
|  10-15-2006, 07:14 AM | #24 | |
| Yes that IS me. Bitch. Industry Role:  Join Date: Nov 2001 
					Posts: 14,149
				 | Quote: 
 Certainly there are other various methods of getting a simple potd/motd, etc to work, however, standard potd/motd, etc are only images & links, whereas what I want to accomplish is similar to the method of Jaymancash & some others where the potd/motd etc is enclosed within a table so that there is also text, etc, so that with other webmasters placing the php include on their pages would have my table/image etc being displayed on their sites, but the page/table etc is hosted by me.. get it now? If I need be fucking with apache, & all this other server admin shit, looks like I need to have someone do it for me as I haven't a friggen idea about any of that, lol.... I did however spend several hours reading about fread, fopen, etc.. so, eventually can figure all this out, I hope  | |
|   |           | 
|  10-15-2006, 08:38 AM | #25 | |
| Totally Borked Industry Role:  Join Date: Feb 2005 
					Posts: 6,284
				 | Quote: 
 With php, it's a simple include("http://foo.com") with perl/cgi: it's make a client cgi file called "proxy.cgi" with the contents: Code: use LWP::Simple;
print "Content-type:text/html\n\n";
getprint ($ENV{'QUERY_STRING'});<!--#include virtual="/cgi-bin/proxy.pl?http://yourserver.com/yourpage.html" --> 
				__________________  For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 | |
|   |           |