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 01-15-2005, 05:37 PM   #1
donnie
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...
-----------------------------------------------
donnie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 05:38 PM   #2
Sly
Let's do some business!
 
Sly's Avatar
 
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.
Sly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 05:51 PM   #3
Jace
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
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 05:54 PM   #4
Tipsy
Confirmed User
 
Join Date: Jul 2001
Location: See sig
Posts: 6,989
Quote:
Originally Posted by JaceXXX
you can't call php from an html page
You can with a very small change to apache or sometimes htaccess. It can be very useful sometimes.
__________________
Ignorance is never bliss.
Tipsy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 05:54 PM   #5
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Tipsy
You can with a very small change to apache or sometimes htaccess. It can be very useful sometimes.
yeah, but for us normal folks it is just easier to rename the file to php
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 06:11 PM   #6
Azlord
Confirmed User
 
Azlord's Avatar
 
Industry Role:
Join Date: Dec 2003
Location: City... City of Satan
Posts: 2,651
yah but the hun won't take php galleries.
Azlord is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 06:14 PM   #7
Tipsy
Confirmed User
 
Join Date: Jul 2001
Location: See sig
Posts: 6,989
Quote:
Originally Posted by JaceXXX
yeah, but for us normal folks it is just easier to rename the file to php
Depends on the usage. Sometimes naming the file php can cause problems and it's not a hard thing to do even for 'normal' folks. It'd only be difficult on some virtual accounts where the htaccess is restrictive.
__________________
Ignorance is never bliss.
Tipsy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 06:14 PM   #8
Dalai lama
Strength and Honor
 
Join Date: Jul 2004
Location: Europe
Posts: 16,540
Quote:
Originally Posted by Sly
<? include ("file.php"); ?>

Unless something has drastically changed over the past 3 years.

nothing has changed, good call
__________________

A program you can trust.
Gallerybooster Run multiply TGPs of 1 script
Dalai lama is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 06:48 PM   #9
MikeXAMO
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.
MikeXAMO is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-15-2005, 06:54 PM   #10
Antonio
Too lazy to set a custom title
 
Antonio's Avatar
 
Join Date: Oct 2001
Location: Spartaaaaaaaaa
Posts: 14,136
I use
<!--#include virtual="MyFile.php"-->
on a .shtml page
Antonio 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.