PHP pros, need help with something simple..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hardcore J
    Hardcore 4 Life™
    • Mar 2003
    • 2553

    #1

    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
    So Fucking Banned
    • Aug 2003
    • 5464

    #2
    Uhm.. change all the 4's to 8's

    Comment

    • Hardcore J
      Hardcore 4 Life™
      • Mar 2003
      • 2553

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

      Comment

      • fiveyes
        Confirmed User
        • Aug 2001
        • 1680

        #4
        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.
        <CENTER><A HREF="http://www.hot-off-bourbon.com/" target="_blank"><IMG SRC="http://www.hot-off-bourbon.com/images/hob-logosmall.jpg" border="0"></A>

        <FONT face="Comic Sans MS" SIZE="-1"><I>Mardi Gras, Spring Break, Wet-T, Night Club Action, UpSkirt, Oil Wrestling, Voyeur</I></FONT></CENTER>

        Comment

        • JDog
          Confirmed User
          • Feb 2003
          • 7453

          #5
          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
          NSCash now powering ReelProfits.com
          ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD
          PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash
          NOW OFFERING OVER 60 SITES
          CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133)

          Comment

          • JSA Matt
            So Fucking Banned
            • Aug 2003
            • 5464

            #6
            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);
                    }
                } 
            

            Comment

            • kevinale
              Confirmed User
              • Dec 2002
              • 2115

              #7
              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>
              1monkey0cup.com

              Comment

              • 4Pics
                Confirmed User
                • Dec 2001
                • 7952

                #8
                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...

                Comment

                • calm
                  Confirmed User
                  • Aug 2003
                  • 1191

                  #9
                  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>
                  <a href="http://www.pimproll.com/"><img src=http://www.pimproll.com/banners/pimproll_468x60_02-3.gif border=0><br>bling bling</a><br><a href="http://www.exitking.com/?ID=40" target=_blank>$3.00 CPM -- NO SHAVING -- NO CONVERSIONS -- ALL YOUR HITS COUNTED</a><br>sign up under <a href="mailto:[email protected]">me</a> and <a href="mailto:[email protected]">I'll</a> send you 10k hits.

                  Comment

                  • Hardcore J
                    Hardcore 4 Life™
                    • Mar 2003
                    • 2553

                    #10
                    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!
                    Last edited by Hardcore J; 10-01-2003, 09:56 PM.

                    Comment

                    • adultwebware
                      Confirmed User
                      • Nov 2002
                      • 563

                      #11
                      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

                      THE EXPERIENCED paysite automation.
                      Simple. Powerful. Efficient. 5 years ripe.

                      Comment

                      • Evil1
                        Confirmed User
                        • Mar 2002
                        • 3893

                        #12
                        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?

                        Comment

                        • Babaganoosh
                          ♥♥♥ Likes Hugs ♥♥♥
                          • Nov 2001
                          • 15841

                          #13
                          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?
                          I like pie.

                          Comment

                          Working...