'lil PHP help.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • - Jesus Christ -
    Confirmed User
    • Mar 2003
    • 7197

    #1

    'lil PHP help.

    Will this work...and is there a way to make the code cleaner/faster? Its going to be processed like a couple times a second.

    Any input appreciated (cuz IM no programmer)
    Its supposed to redirect but I don't even know if my header line is right.

    PHP Code:
    <?php
    // Random URL From File
    srand((double)microtime()*1000000);
    $list=file("URLLIST.txt");
    $url=rand(0, count($list)-1);
    header("Location: $url");
    ?>

    Amen
  • Damian_Maxcash
    So Fucking Banned
    • Oct 2002
    • 12745

    #2
    Heres a little script I use..... works like a dream

    randomurl.zip

    Comment

    • cj-design
      Confirmed User
      • Apr 2003
      • 378

      #3
      Originally posted by - Jesus Christ -
      [B]Will this work...and is there a way to make the code cleaner/faster? Its going to be processed like a couple times a second...
      It will work, but not sure what srand does in your script!

      Comment

      • jollyperv
        Confirmed User
        • Nov 2001
        • 3927

        #4
        Jesus Christ should know the answer.

        Comment

        • OzKaNoz
          Confirmed User
          • Jan 2001
          • 1834

          #5
          Originally posted by jollyperv
          Jesus Christ should know the answer.
          Damn you, that was what I was going to say.


          Oz
          Techie Media Web Hosting

          Comment

          • tical
            Confirmed User
            • Feb 2002
            • 6504

            #6
            Originally posted by cj-design


            It will work, but not sure what srand does in your script!
            That seeds the random number generator... for a 'truly random' number
            112.020.756

            Comment

            Working...