![]() |
![]() |
![]() |
||||
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 |
![]() |
#1 |
Confirmed User
Join Date: Jan 2003
Posts: 1,630
|
How to call PHP script from a page??
I have this gallery rotator script but I don't know how to call it from my page.
What should I write on my page to get link to a random gallery?? Here is the script: random.php ----------------------------------------------- <? $delim = "\n"; $cryfile = "galleries.txt"; $fp = fopen($cryfile, "r"); $contents = fread($fp, filesize($cryfile)); $cry_arr = explode($delim,$contents); fclose($fp); srand((double)microtime()*1000000); $cry_index = (rand(1, sizeof($cry_arr)) - 1); $herecry = $cry_arr[$cry_index]; echo $herecry; ?> ----------------------------------------------- galleries.txt ----------------------------------------------- <a href="gallery1.url">Gallery 1 Description</a> <a href="gallery2.url">Gallery 2 Description</a> <a href="gallery3.url">Gallery 3 Description</a> etc... ----------------------------------------------- |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Let's do some business!
Industry Role:
Join Date: Sep 2004
Location: Austin, TX
Posts: 31,329
|
<? include ("file.php"); ?>
Unless something has drastically changed over the past 3 years.
__________________
Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted Windows VPS now available Great for TSS, Nifty Stats, remote work, virtual assistants, etc. Click here for more details. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
FBOP Class Of 2013
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
|
and make sure the page you are calling it from is named something.php
you can't call php from an html page i made that mistake the first time, took me 2 hours to figure out what I was doing wrong |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 | |
Confirmed User
Join Date: Jul 2001
Location: See sig
Posts: 6,989
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
FBOP Class Of 2013
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Dec 2003
Location: City... City of Satan
Posts: 2,651
|
yah but the hun won't take php galleries.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Jul 2001
Location: See sig
Posts: 6,989
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Strength and Honor
Join Date: Jul 2004
Location: Europe
Posts: 16,540
|
Quote:
nothing has changed, good call ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Mar 2002
Location: Trailer Park
Posts: 660
|
I always recommend making a simple change to apache to run PHP in .html files. You simply add the line "AddType application/x-httpd-php .html" in your httpd.conf file. If you wanna get real crazy, you can make your php files appear as HTML files (i.e. Don't output the PHP header on PHP processed pages) by setting "expose_php = Off" in your php.ini file. Good thing to do for gallery makers!
__________________
Xamo Entertainment Xamo.com | EZSets.com ![]() ICQ: 9439118 MSN: mikeb [at] xamo.com Tollfree: 800-544-XAMO XXX CMS - Designed by Adult Webmasters, for Adult Webmasters. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Too lazy to set a custom title
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
|
I use
<!--#include virtual="MyFile.php"--> on a .shtml page |
![]() |
![]() ![]() ![]() ![]() ![]() |