PHP Gurus.. I need a small script...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • XXXPaysiteDesign
    Confirmed User
    • Mar 2002
    • 2201

    #1

    PHP Gurus.. I need a small script...

    Okay, I'm going to be helping a friend out with some stuff, I need a script that will generate a banner with my ref code 25% of the time and his 75% of the time.

    The banner will always have the same path.
    Last edited by XXXPaysiteDesign; 12-27-2002, 07:20 PM.
    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.
  • multisexsite
    Confirmed User
    • Oct 2002
    • 929

    #2
    Shouldnt be too hard, try 9287771 on ICQ

    NOTE - its not me.

    Comment

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

      #3
      can be done in java.....no need for php
      Don't let greediness blur your vision | You gotta let some shit slide
      icq - 441-456-888

      Comment

      • kevinale
        Confirmed User
        • Dec 2002
        • 2115

        #4
        <?php

        $refcode1 = "http://program.com/r.php?id=his";
        $refcode2 = "http://program.com/r.php?id=mine";

        $whichone = rand(1,4);

        function addLink(){
        if($whichone < 4)
        echo $refcode1;
        else
        echo $refcode2;
        }

        ?>

        later in your html you'll have

        &lt;a href="&lt;?php addLink(); ?>"> CLICK HERE &lt;/a>

        or whatever floats your boat.. simple, but it should work..

        -kevin
        Last edited by kevinale; 12-27-2002, 07:40 PM.
        1monkey0cup.com

        Comment

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

          #5
          Originally posted by kevinale
          &lt;?php

          $refcode1 = "http://program.com/r.php?id=his";
          $refcode2 = "http://program.com/r.php?id=mine";

          $whichone = rand(1,4);

          function addLink(){
          if($whichone < 4)
          echo $refcode1;
          else
          echo $refcode2;
          }

          ?>

          later in your html you'll have

          &lt;a href="&lt;?php addLink(); ?>"> CLICK HERE &lt;/a>

          or whatever floats your boat.. simple, but it should work..

          -kevin
          you can do almost the same in java....same outline,
          instead of echo use print and call the script on the place where you want the banner
          Last edited by grumpy; 12-27-2002, 07:42 PM.
          Don't let greediness blur your vision | You gotta let some shit slide
          icq - 441-456-888

          Comment

          • zoic
            Registered User
            • Nov 2001
            • 84

            #6
            If you're using a version of PHP before 4.2, you'll need to put this in as your first line -

            srand((double)microtime()*1000000);

            z

            Comment

            • -=HUNGRYMAN=-
              Confirmed User
              • Jun 2001
              • 4753

              #7
              Go with the PHP though ... MUCH more efficient than java IMHO

              Comment

              • XXXPaysiteDesign
                Confirmed User
                • Mar 2002
                • 2201

                #8
                thanks guys.
                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

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

                  #9
                  not for something like this...let the computer of the visitor do the work instead of your sever.
                  Don't let greediness blur your vision | You gotta let some shit slide
                  icq - 441-456-888

                  Comment

                  • XXXPaysiteDesign
                    Confirmed User
                    • Mar 2002
                    • 2201

                    #10
                    Originally posted by grumpy
                    not for something like this...let the computer of the visitor do the work instead of your sever.
                    Some people don't have java enabled, if I'm not mistaken php can't be disabled?
                    Last edited by XXXPaysiteDesign; 12-27-2002, 07:59 PM.
                    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

                    Working...