Create Random data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Create Random data



    i want to make a script that when i visit a page named index.php it will change the test1 and toystory1 to any random alphanumeric text and visit the url, i think this is very easy but just cant figure out how. Can anyone help me pls?
    Serverside or browserside(javascript), any will do.

    #2
    PHP Code:
    <?php
    $array 
    = ["something","else","hello","world"];
    $rand rand(count($array));
    echo 
    $array[$rand];
    ?>

    Comment


      #3
      Originally posted by something else View Post
      PHP Code:
      <?php
      $array 
      = ["something","else","hello","world"];
      $rand rand(count($array));
      echo 
      $array[$rand];
      ?>
      I figured out that myself, but it just posts the four words given, they can easily be guessed. I want alphanumeric numbers generated which can not(unless extremely lucky) guessed. Thats where im getting stuck :-(

      Comment


        #4
        hers a random string generator (i did not script this)
        PHP Code:
        $len 16;
        $base='ABCDEFGHKLMNOPQRSTWXYZabcdefghjkmnpqrstwxyz123456789';
        $max=strlen($base)-1;
        $activatecode='';
        mt_srand((double)microtime()*1000000);
        while (
        strlen($activatecode)<$len+1)
          
        $activatecode.=$base{mt_rand(0,$max)};
          
        echo 
        $activatecode

        Comment


          #5
          Tnx bro, can you also tell me how to make a cronjob to visit refer.php in my servers public_files every 2 or 3 minutes?

          Comment


            #6
            why do you need to use cron ? cant you script it to make your referers do the work for you?

            Comment


              #7
              Something else, how did u manage to make random string so complicated my man.

              PHP Code:
              $random substrsha1uniqidrand(), TRUE ) ), 10 ); 

              Comment


                #8
                like i said i didnt script it lol

                Comment

                Working...
                X