Programmers I pay $10 epassporte for a very simple script!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sony
    Confirmed User
    • Dec 2002
    • 495

    #1

    Programmers I pay $10 epassporte for a very simple script!

    Here is an example of what I want:

    http://www.ronisparadise.net/fhg/gal...hp?user=XXXXXX

    I need made a php file which will change the affiliate code inside a gallery accoring the change made in the URL.

    e.g If I replace the XXXXXX in the URL with 234122 then all links in the gallery will have the XXXXXX replaced with 234122

    http://www.ronisparadise.net/fhg/gal...hp?user=234122

    ICQ: 171739496
  • k0nr4d
    Confirmed User
    • Aug 2006
    • 9231

    #2
    hitting you up on icq
    Mechanical Bunny Media
    Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

    Comment

    • V_RocKs
      Damn Right I Kiss Ass!
      • Nov 2003
      • 32449

      #3
      Make sure it sanitizes that input too.

      Comment

      • SmokeyTheBear
        ►SouthOfHeaven
        • Jun 2004
        • 28609

        #4
        Code:
        <?php
        $id = $_GET['id'];
        $stuff = file_get_contents("template.txt");
        $html = str_replace("123456",$id,$stuff);
        echo $html;
        ?>
        save that as index.php

        save all your html in a file called template.txt with refcode as 123456

        then just call the index.php like index.php?id=5551212
        hatisblack at yahoo.com

        Comment

        • SmokeyTheBear
          ►SouthOfHeaven
          • Jun 2004
          • 28609

          #5
          yes i suppose you might wanna santatize it a bit
          hatisblack at yahoo.com

          Comment

          • k0nr4d
            Confirmed User
            • Aug 2006
            • 9231

            #6
            Originally posted by SmokeyTheBear
            Code:
            <?php
            $id = $_GET['id'];
            $stuff = file_get_contents("template.txt");
            $html = str_replace("123456",$id,$stuff);
            echo $html;
            ?>
            save that as index.php

            save all your html in a file called template.txt with refcode as 123456

            then just call the index.php like index.php?id=5551212
            For what he needs, <? echo strip_tags($_REQUEST['user']) ; ?> right in the gallery is plenty. No point reading in another file...
            Mechanical Bunny Media
            Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

            Comment

            • SmokeyTheBear
              ►SouthOfHeaven
              • Jun 2004
              • 28609

              #7
              Originally posted by k0nr4d
              For what he needs, <? echo strip_tags($_REQUEST['user']) ; ?> right in the gallery is plenty. No point reading in another file...
              true but if he has alot of places to change it would be shorter is all i was thinking
              hatisblack at yahoo.com

              Comment

              • Sony
                Confirmed User
                • Dec 2002
                • 495

                #8
                Originally posted by k0nr4d
                hitting you up on icq
                Thanks Smokey for input, but I choosed to use k0nr4d code since is a bit easier. He sent me the code on ICQ and he didn't wanted to take my money Thank you again mate!

                Comment

                • k0nr4d
                  Confirmed User
                  • Aug 2006
                  • 9231

                  #9
                  Originally posted by SmokeyTheBear
                  true but if he has alot of places to change it would be shorter is all i was thinking
                  ahh yes didn't think of that.
                  Mechanical Bunny Media
                  Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development

                  Comment

                  • SmokeyTheBear
                    ►SouthOfHeaven
                    • Jun 2004
                    • 28609

                    #10
                    Originally posted by Sony
                    Thanks Smokey for input, but I choosed to use k0nr4d code since is a bit easier. He sent me the code on ICQ and he didn't wanted to take my money Thank you again mate!
                    no probs. i suggets always asking first , lots of people still dont mind helping for free. then if you need more customization you have a few choices based on answers. ( and for others who might also want the same thing and for reference )



                    p.s. if you want to have se friendly urls you could use his code with the following
                    ( assuming there are no asp pages in the directory )

                    save this as .htaccess and upload to the same directory
                    Code:
                    RewriteEngine on
                     RewriteRule ^(.*)\.asp index.php?user=$1 [nc]
                    this way you can call your pages like
                    http://yoursite.com/stuff/refcode.asp
                    and it will turn into
                    http://yoursite.com/stuff/index.php?user=refcode
                    hatisblack at yahoo.com

                    Comment

                    • rowan
                      Too lazy to set a custom title
                      • Mar 2002
                      • 17393

                      #11
                      Originally posted by k0nr4d
                      For what he needs, <? echo strip_tags($_REQUEST['user']) ; ?> right in the gallery is plenty. No point reading in another file...
                      If the ID consists of digits only then you can force it to an integer by adding it to a number:

                      <?php echo (0 + $_REQUEST["user"]); ?>

                      Comment

                      • Iron Fist
                        Too lazy to set a custom title
                        • Dec 2006
                        • 23400

                        #12
                        Good thread
                        i like waffles

                        Comment

                        Working...