How do you do this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mashiyoshi
    Registered User
    • Nov 2005
    • 3

    #1

    How do you do this?

    I hope all you experts can help me. What would be the simplest and best way to accomplish the following:

    1. Select 1 random visitor to my site.
    2. Redirect the selected visitor to a different page where they will fill out a form.

    How would you approach this?
  • twan
    Confirmed User
    • Aug 2003
    • 798

    #2
    It depends how many visitors you have, but you could send every 10th visitor to your form. Of course 10th could also be 100th, it depends how much visitors you have and when they all visit your site.

    Blog Submitter, submit to 15 blog dirs with 1 form.
    Free WordPress Blog Hosting - Become a Thumblogger Affiliate!

    Comment

    • Jmonk
      Confirmed User
      • May 2004
      • 115

      #3
      You could write a little php script that has an X% chance of sending the visitor to your form and a (100-X)% chance of sending to the expected destination.

      Comment

      • mashiyoshi
        Registered User
        • Nov 2005
        • 3

        #4
        That sounds like a good way to approach it. Do you know of a script that does what you just said?

        Comment

        • Jmonk
          Confirmed User
          • May 2004
          • 115

          #5
          Many skimming scripts work that way. Couple lines of php should do it. Just send out a http header that sends the visitor to your form when a 1-to-10 random number is below, say, 3. If it's equal or higher, you send the visitor to the url that he expects (which you sent along through http GET).

          Comment

          • Dynamix
            G F Y not
            • Jan 2004
            • 2910

            #6
            This would send a visitor to the form page 33% of the time (0-2 = 3 numbers, odds of hitting one number is 33%.. change 0,2 to 0,3 for 25%, 0,4 20%, etc.)

            Code:
            <?php
            srand ((double) microtime( )*1000000);
            $random_number = rand(0,2);
            if ($random_number hahahaha 1) { header("Location: http://url-to-form/"); }
            ?>

            TGPFactory Full TGP Design & Installation Services
            ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
            See who I am at AdultWhosWho.com!

            Comment

            • Dynamix
              G F Y not
              • Jan 2004
              • 2910

              #7
              that hahahaha should be two equals signs adjacent to one another (= = without the space)

              TGPFactory Full TGP Design & Installation Services
              ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
              See who I am at AdultWhosWho.com!

              Comment

              Working...