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 11-29-2004, 10:23 AM   #1
crockett
in a van by the river
 
crockett's Avatar
 
Industry Role:
Join Date: May 2003
Posts: 76,806
:mad PHP experts

PHP people... I know almost nothing about scripting but I'm trying to make something work. I have this simple script which I use to rotate adds on a page using a server side includes.

well I'm making a new site and I need to link two of these scripts together on the same page. I want to show the adds but I also want to include an extra file that would contain few pictures relating to that add (pictures will be on a html page linked to galleries).

so this is the basic script I'm using for the adds..

PHP Code:
<?php
$files 
= array();

// Define
$files[] = 'hardcore-01.html';
$files[] = 'hardcore-02.html';


$num rand(0,sizeof($files)-1);

readfile($files[$num]);
?>
I would like to rotate matching pictures with the related add (hence pictures from that site) However due to the design I can't make the adds and the picture on the same HTML and include them with one SSI include, they have to be seprate due to the page design.


this would be the script for the gallery sections. (same as above)

PHP Code:
<?php
$files 
= array();

// Define
$files[] = 'hardcoregallery-01.html';
$files[] = 'hardcoregallery-02.html';


$num rand(0,sizeof($files)-1);

readfile($files[$num]);
?>
Is there anyway I can link the two scripts together? so when 'hardcore-01.html' shows on the page then 'hardcoregallery-01.html' would also show in it's spot on the same page?

Also if there is an easier way I'm all ears..
__________________
In November, you can vote for America's next president or its first dictator.
crockett is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2004, 10:49 AM   #2
LoveHenk
Confirmed User
 
Join Date: May 2004
Location: Netherlands
Posts: 308
Try this:

<?php
$files = array();

// Define
$files[] = 'hardcore-01.html';
$files[] = 'hardcore-02.html';

$files2 = array();
// Define
$files2[] = 'hardcoregallery-01.html';
$files2[] = 'hardcoregallery-02.html';


$num = rand(0,sizeof($files)-1);

readfile($files[$num]);
readfile($files2[$num]);
?>
LoveHenk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2004, 10:58 AM   #3
crockett
in a van by the river
 
crockett's Avatar
 
Industry Role:
Join Date: May 2003
Posts: 76,806
would I still use the orginal PHP scipts and this one would just link them together?
__________________
In November, you can vote for America's next president or its first dictator.
crockett is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2004, 11:01 AM   #4
LoveHenk
Confirmed User
 
Join Date: May 2004
Location: Netherlands
Posts: 308
this is ur include right? u had 2 includes, now u have 1. try if it works.

Don't exactly what you mean.
LoveHenk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2004, 11:12 AM   #5
crockett
in a van by the river
 
crockett's Avatar
 
Industry Role:
Join Date: May 2003
Posts: 76,806
Quote:
Originally posted by LoveHenk
this is ur include right? u had 2 includes, now u have 1. try if it works.

Don't exactly what you mean.
well they need to be in seprate places on the page.


for example:




top of page has include number 1

-------------------------------------------

other stuff here

-------------------------------------------

mid page comes include number 2

-----------------------------------------------

then more junk here (bottom of page)





so the way the design is set up I really can't just use one include, I need to have two seprate ones. But I'm trying to link them together so they show the add and the pictures from the same site.
__________________
In November, you can vote for America's next president or its first dictator.
crockett is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2004, 12:22 PM   #6
LoveHenk
Confirmed User
 
Join Date: May 2004
Location: Netherlands
Posts: 308
<?php
$files = array();

// Define
$files[] = 'hardcore-01.html';
$files[] = 'hardcore-02.html';

$files2 = array();
// Define
$files2[] = 'hardcoregallery-01.html';
$files2[] = 'hardcoregallery-02.html';


$num = rand(0,sizeof($files)-1);
?>

stuff here

<?php readfile($files[$num]); ?>

stuff here

<?php readfile($files2[$num]); ?>

stuff here
LoveHenk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 11-29-2004, 03:09 PM   #7
crockett
in a van by the river
 
crockett's Avatar
 
Industry Role:
Join Date: May 2003
Posts: 76,806
cool man that looks like it will do the trick... damn I am really going to have to learn PHP.. I have a book on it and I've been reading it. But I'm not that far into it yet..

thanks
__________________
In November, you can vote for America's next president or its first dictator.
crockett 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.