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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-14-2006, 04:56 AM   #1
spacedog
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:
<?=file_get_contents("http://www.domain.com/file.htm")?>
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:16 AM   #2
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
bump.. please help
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:20 AM   #3
Adultnet
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!
Adultnet is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:23 AM   #4
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by Adultnet View Post
<!--#include file="filename.what ever" -->
that don't work either
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:53 AM   #5
AnnaSucks
Confirmed User
 
Join Date: Jun 2006
Location: Finland
Posts: 279
Quote:
Originally Posted by spacedog View Post
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?
Do you mean you want to have that code on a page other than .php or you want to include files other than .php? I don't think you can put php ON a .html page, but you sure can INCLUDE a html page on a .php page. If that makes any sense.

This one has always worked for me:

PHP Code:
<?php include "file.php"?>
__________________
Quote:
A man without a belly is not a man
AnnaSucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:57 AM   #6
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,327
Quote:
Originally Posted by spacedog View Post
that don't work either
.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
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:28 PM   #7
spacedog
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
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:32 PM   #8
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
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.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:35 PM   #9
bl4h
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:
AddType application/x-httpd-php .html .htm
heres how you include. Name the file with whatever you want to include something like ass.inc

PHP Code:
<?PHP include 'ass.inc'?>
Including the file remotely? STUPID THING TO DO.
bl4h is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:36 PM   #10
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by toonpornblog View Post
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.
but the php include needs to work externally.. sites that are not my own. I believe the .htaccess only allows this to work on sites on my own server..right?
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:39 PM   #11
bl4h
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..
bl4h is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:42 PM   #12
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by bl4h View Post
Produce an XML file and build a script to parse and display it on external hosts.

You dont use include for external stuff..
have you seen jaymancash's potd/motd plugin?

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
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:44 PM   #13
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by spacedog View Post
but the php include needs to work externally.. sites that are not my own. I believe the .htaccess only allows this to work on sites on my own server..right?
Well, yeah. If they're trying to put PHP in a non .php file or don't have the types set, it's their own problem with implementation.

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.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:46 PM   #14
bl4h
Confirmed User
 
Join Date: Jul 2006
Location: Philadelphia
Posts: 1,282
Quote:
Originally Posted by spacedog View Post
have you seen jaymancash's potd/motd plugin?

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
well thats just plain stupid. Let me sign up and check this out
bl4h is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:54 PM   #15
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by bl4h View Post
well thats just plain stupid. Let me sign up and check this out
it works for them, & I want to do the same thing.. their code works on my .htm pages & .php, etc.. but when I create my own page & try to include it, it only works on .php.. maybe I should ask jay
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 04:59 PM   #16
nolaman
Confirmed User
 
Join Date: Mar 2004
Location: New Orleans, LA
Posts: 1,001
try using fread()
__________________
PHP Programmer ICQ 215-504-788
nolaman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:01 PM   #17
bl4h
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
bl4h is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 05:16 PM   #18
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by bl4h View Post
Well i dont think theyre using include then if it works in html files. whatever. Its your shit
yep, it sure looks like a php include..

PHP Code:
 <?=file_get_contents("http://www.jaymancash.com/POTD/Raven-Riley/MTOjEx/150/150/")?>
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 11:49 PM   #19
borked
Totally Borked
 
borked's Avatar
 
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
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-14-2006, 11:54 PM   #20
borked
Totally Borked
 
borked's Avatar
 
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
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-15-2006, 12:17 AM   #21
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by borked View Post
that said, you clients also have to have it enabled.
Have a look at Apache SSI
He's trying to do a remote url open. I've never seen SSI support that, because, well, it's retarded, and wrong. You can't do a <!--#include "http://foo" -->
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-15-2006, 04:25 AM   #22
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,327
you can do a php include with a full url
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-15-2006, 04:51 AM   #23
bl4h
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
bl4h is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-15-2006, 07:14 AM   #24
spacedog
Yes that IS me. Bitch.
 
Industry Role:
Join Date: Nov 2001
Posts: 14,149
Quote:
Originally Posted by bl4h View Post
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
You're missing the point here.. I'm not talking about rotating images or tables on my own sites, I am talking about rotating tables/images of MINE to be able to be php included on OTHER PEOPLES pages.. were I disussing my own pages, I would just code right into the page itself, or include with php extension, but since I am trying to have this include work on others pages, the page/table/image being included coming from my domain & hosting, & the php include string being called from a different domain/host.

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
spacedog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-15-2006, 08:38 AM   #25
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
Quote:
Originally Posted by spacedog View Post
You're missing the point here.. I'm not talking about rotating images or tables on my own sites, I am talking about rotating tables/images of MINE to be able to be php included on OTHER PEOPLES pages.. were I disussing my own pages, I would just code right into the page itself, or include with php extension, but since I am trying to have this include work on others pages, the page/table/image being included coming from my domain & hosting, & the php include string being called from a different domain/host.

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
I had it working fine with php and with perl (for those that didn't have php remote include configured in their php) long before AFF did their geoIP ads - I had over 300 people using my ad includes and made me a mint.

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'});
then have the clients add this code wherever they want to include your html:

<!--#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
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.