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)
-   -   PHP pros, need help with something simple.. (https://gfy.com/showthread.php?t=181444)

Hardcore J 10-01-2003 02:47 PM

PHP pros, need help with something simple..
 
I have a script I had written for my paysites, it rotates a different html page every day, 5 different pages rotate total.

Here is the code, how would I need to tweek this in order to make it rotate 9 different pages total instead of 5?

Thanks in advance!

< ? php $day = date("z");
if($day >4)
{
while($day > 4)
{
$day = ($day - 4); }
}
include("0$day.html");
?>

JSA Matt 10-01-2003 02:50 PM

Uhm.. change all the 4's to 8's :)

Hardcore J 10-01-2003 02:51 PM

Quote:

Originally posted by JSA Matt
Uhm.. change all the 4's to 8's :)
Wouldn't that make it rotate 10 instead of 9 ?

fiveyes 10-01-2003 02:58 PM

Quote:

Originally posted by Hardcore J


Wouldn't that make it rotate 10 instead of 9 ?

No, you'd have 0-8 as your result, nine numbers. Also, you can remove the enclosing "if" statement, it doesn't do anything that the "while" isn't taking care of.

JDog 10-01-2003 03:00 PM

Quote:

Originally posted by fiveyes

No, you'd have 0-8 as your result, nine numbers. Also, you can remove the enclosing "if" statement, it doesn't do anything that the "while" isn't taking care of.

Finally another person that starts counting at 0. Nobody believes me when I say I have to start counting at 0. Your cool! hehe

jDoG

JSA Matt 10-01-2003 03:02 PM

Quote:

Originally posted by Hardcore J


Wouldn't that make it rotate 10 instead of 9 ?

Actually since it doesn't count zero.. change all the 4's to 9's.

Results from my test:

Day: 269, 08.html
Day: 270, 09.html
Day: 271, 01.html

PHP Code:

    if ($day 9)    {
        while(
$day 9)    {
            
$day = ($day 9);
        }
    } 


kevinale 10-01-2003 04:58 PM

Quote:

Originally posted by Hardcore J
I have a script I had written for my paysites, it rotates a different html page every day, 5 different pages rotate total.

Here is the code, how would I need to tweek this in order to make it rotate 9 different pages total instead of 5?

Thanks in advance!

< ? php $day = date("z");
if($day >4)
{
while($day > 4)
{
$day = ($day - 4); }
}
include("0$day.html");
?>

The most elegant way is to do this:

<pre>
< ? php
$NUMPAGES = 9;
$day = date("z") % $NUMPAGES;
include("0$day.html");
?>
</pre>

4Pics 10-01-2003 05:03 PM

Quote:

Originally posted by kevinale


The most elegant way is to do this:

<pre>
< ? php
$NUMPAGES = 9;
$day = date("z") % $NUMPAGES;
include("0$day.html");
?>
</pre>

Nice...

calm 10-01-2003 05:04 PM

Quote:

Originally posted by kevinale


The most elegant way is to do this:

<pre>
< ? php
$NUMPAGES = 9;
$day = date("z") % $NUMPAGES;
include("0$day.html");
?>
</pre>

:thumbsup

Hardcore J 10-01-2003 10:49 PM

Quote:

Originally posted by kevinale


The most elegant way is to do this:

<pre>
< ? php
$NUMPAGES = 9;
$day = date("z") % $NUMPAGES;
include("0$day.html");
?>
</pre>

Wow, thats quite a bit easier, huh?

Thanks!

adultwebware 10-02-2003 09:15 AM

AdultWebware v3.5 can rotate whatever you want for you.
I.e. make daily updates without spending a minute.



I am always available for conversations of any kind here:

Email: [email protected]
MSN: [email protected]
ICQ: 166487010

Evil1 10-02-2003 09:21 AM

Quote:

Originally posted by adultwebware
AdultWebware v3.5 can rotate whatever you want for you.
I.e. make daily updates without spending a minute.



I am always available for conversations of any kind here:

Email: [email protected]
MSN: [email protected]
ICQ: 166487010

That spam would have been better if you went ahead and did it before he had a solution.. what is it with you people?

Babaganoosh 10-02-2003 09:31 AM

Quote:

Originally posted by Evil1


That spam would have been better if you went ahead and did it before he had a solution.. what is it with you people?

That shit's getting old in a hurry, huh?


All times are GMT -7. The time now is 09:22 AM.

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