I need a simple PHP script!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 3Xguru
    Confirmed User
    • Sep 2001
    • 1281

    #1

    I need a simple PHP script!

    I need a simple PHP script that will redirect the surfer to a random gallery. It must not use MySQL.
    I know it's simple but I don't know much PHP so I was wondering if there is such a script somewere free.
    -=Free Webmaster Tools=-
  • playa
    Confirmed User
    • Feb 2001
    • 6432

    #2
    you can use mine

    www.cleangalleries.net

    Comment

    • 3Xguru
      Confirmed User
      • Sep 2001
      • 1281

      #3
      Originally posted by playa
      you can use mine

      www.cleangalleries.net
      I may use this, but right now I want to list my own galleries... and this is why i need the script.
      -=Free Webmaster Tools=-

      Comment

      • LoveAsianChicks
        Registered User
        • Mar 2002
        • 1464

        #4
        http://www.perl-coders.com
        $15 has a redirect script.

        I don't know any free ones, maybe you write one if you looked at some guides.

        Comment

        • playa
          Confirmed User
          • Feb 2001
          • 6432

          #5
          contact me on ICQ,,i'll set you up

          Comment

          • Robert
            Ask me about negative cash flow
            • Feb 2001
            • 533

            #6
            $gals=File("file_with_URLs");
            SRand((double)Microtime()*1e6);
            $n=rand(0,count($gals));
            Header ("Location: $gals[$n]");
            SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

            Comment

            • 3Xguru
              Confirmed User
              • Sep 2001
              • 1281

              #7
              Originally posted by Robert
              $gals=File("file_with_URLs");
              SRand((double)Microtime()*1e6);
              $n=rand(0,count($gals));
              Header ("Location: $gals[$n]");
              Do I make a text file with that script rename it to PHP and another text file with the gall URL?
              -=Free Webmaster Tools=-

              Comment

              • Robert
                Ask me about negative cash flow
                • Feb 2001
                • 533

                #8
                Originally posted by 3Xguru


                Do I make a text file with that script rename it to PHP and another text file with the gall URL?
                yes, put this:
                <?
                $gals=File("babes.txt");
                SRand((double)Microtime()*1e6);
                $n=rand(0,count($gals));
                Header ("Location: $gals[$n]");
                ?>

                to "babe.php3" file and create "babes.txt" ... each URL on new line:

                http://ultra-babes.com/cmpg48/smt.html
                http://www.hadesporn.com/pussy/claudia/index03.htm
                ..
                ..

                and do the same with all your caategories:

                teen.php3 ..
                <?
                $gals=File("teens.txt");
                SRand((double)Microtime()*1e6);
                $n=rand(0,count($gals));
                Header ("Location: $gals[$n]");
                ?>

                teens.txt:

                gallery URL 1
                gallery URL 2
                ..
                gallery URL N

                etc.

                hope that helps
                SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

                Comment

                • Robert
                  Ask me about negative cash flow
                  • Feb 2001
                  • 533

                  #9
                  shit, it screwed coding
                  look here for correct version:
                  http://www.smashingthumbs.com/script.txt
                  SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

                  Comment

                  • 3Xguru
                    Confirmed User
                    • Sep 2001
                    • 1281

                    #10
                    Thank you Robert.
                    This helps a lot... it is exactly what I needed!
                    -=Free Webmaster Tools=-

                    Comment

                    • Robert
                      Ask me about negative cash flow
                      • Feb 2001
                      • 533

                      #11
                      you're welcome
                      I'm glad it helped you
                      SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

                      Comment

                      • Viper2K1
                        Confirmed User
                        • Aug 2001
                        • 1006

                        #12
                        I'm looking for the same thing, but with cookies so there don't have to be 100 urls in the list to make sure you see a different url when you click like 10 times

                        somebody know how that can be done ?
                        Spank me
                        Dude, where's my traffic?

                        Comment

                        • Robert
                          Ask me about negative cash flow
                          • Feb 2001
                          • 533

                          #13
                          Originally posted by Viper2K1
                          I'm looking for the same thing, but with cookies so there don't have to be 100 urls in the list to make sure you see a different url when you click like 10 times

                          somebody know how that can be done ?
                          I know it .. but I'm in hurry .. I must be in the pub in 5 minutes
                          SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.

                          Comment

                          • Brujah
                            Beer Money Baron
                            • Jan 2001
                            • 22157

                            #14
                            Originally posted by Viper2K1
                            I'm looking for the same thing, but with cookies so there don't have to be 100 urls in the list to make sure you see a different url when you click like 10 times

                            somebody know how that can be done ?
                            Code:
                            &lt;?php
                            $urls = @file('urls.txt');
                            
                            if($visited >= count($urls)) $visited = 0;
                            $url = trim($urls[$visited]);
                            
                            $visited++;
                            setcookie("visited",$visited, 86400, '/', '.domain.com', 0);
                            
                            header("Location: $url");
                            ?&gt;

                            Comment

                            • grumpy
                              Too lazy to set a custom title
                              • Jan 2002
                              • 9870

                              #15
                              Why doing this in php....could be a simple javascript
                              Don't let greediness blur your vision | You gotta let some shit slide
                              icq - 441-456-888

                              Comment

                              • Brujah
                                Beer Money Baron
                                • Jan 2001
                                • 22157

                                #16
                                Originally posted by grumpy
                                Why doing this in php....could be a simple javascript
                                why not, when its such a simple php script ?

                                Comment

                                • Viper2K1
                                  Confirmed User
                                  • Aug 2001
                                  • 1006

                                  #17
                                  Brujah, are you sure that code is supposed to work ?

                                  I just tried it and it keeps showing me my index page
                                  (my url isn't in the file with the urls)

                                  Spank me
                                  Dude, where's my traffic?

                                  Comment

                                  • grumpy
                                    Too lazy to set a custom title
                                    • Jan 2002
                                    • 9870

                                    #18
                                    Because then it doesnt load from your server
                                    Don't let greediness blur your vision | You gotta let some shit slide
                                    icq - 441-456-888

                                    Comment

                                    • Viper2K1
                                      Confirmed User
                                      • Aug 2001
                                      • 1006

                                      #19
                                      Sorry, but I don't understand

                                      Can somebody tell me what I'm doing wrong ?
                                      Spank me
                                      Dude, where's my traffic?

                                      Comment

                                      • 3Xguru
                                        Confirmed User
                                        • Sep 2001
                                        • 1281

                                        #20
                                        Originally posted by Viper2K1
                                        Sorry, but I don't understand

                                        Can somebody tell me what I'm doing wrong ?

                                        PHP is a serverside programing language. So you must put the PHP script on your server and then open it!
                                        -=Free Webmaster Tools=-

                                        Comment

                                        • Viper2K1
                                          Confirmed User
                                          • Aug 2001
                                          • 1006

                                          #21
                                          Originally posted by 3Xguru
                                          PHP is a serverside programing language. So you must put the PHP script on your server and then open it!
                                          Well yeah, I know that

                                          when I upload the script in the root directory and point my browser to the script.php file it shows me my index.html

                                          when i upload it in a directory "random" and point my browser to the /random/script.php, it tells me permission denied to view /random/ (because there aint a index.html in that directory)

                                          that random php script from Robert (the one without cookies) is working just fine.
                                          Spank me
                                          Dude, where's my traffic?

                                          Comment

                                          • ServerGenius
                                            Confirmed User
                                            • Feb 2002
                                            • 9377

                                            #22
                                            try http://domain.com/random/script.php :D

                                            hehehe index.html is a DirectoryIndex which means that the webserver looks for the file index.html as the default page.

                                            When it's not there and Indexes are not defined as a valid option it will give you that server error.

                                            DynaMite
                                            | http://www.sinnerscash.com/ | ICQ: 370820 | Skype: SinnersCash | AdultWhosWho |

                                            Comment

                                            • Brujah
                                              Beer Money Baron
                                              • Jan 2001
                                              • 22157

                                              #23
                                              Viper,
                                              yep it works. ICQ me 3431124 if you want and I'll try to see whats wrong for you.

                                              Some possibles
                                              - urls.txt can't be read ?
                                              - urls.txt isn't formatted propery
                                              ( ex. one url per line )
                                              - cookie domain isn't edited ? ' .domain.com ' ?

                                              header location is a redirect.
                                              even if cookies aren't working, it would try to redirect to the url on the 1st line in urls.txt.


                                              php is better than using javascript, since its server-side.
                                              still a small percentage of people browsing without javascript turned on.

                                              Comment

                                              • Viper2K1
                                                Confirmed User
                                                • Aug 2001
                                                • 1006

                                                #24
                                                I'll be damned, now the bitch works just fine

                                                I have no idea what i did different from last time hehe
                                                You probably all think i'm retarded or something ... well maybe you're right


                                                thx for the help !
                                                Spank me
                                                Dude, where's my traffic?

                                                Comment

                                                Working...