1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to hide links in javascript

Discussion in 'BlackHat Lounge' started by dziadekx, Jun 26, 2015.

  1. dziadekx

    dziadekx Newbie

    Joined:
    Feb 20, 2010
    Messages:
    15
    Likes Received:
    1
    Hi guys i have a big question for me

    i try to hide affiliate links link on this page (adult working) ( I can't add urls)

    Code:
     www . ukescorts . directory / escorts / london - escorts /
    or this site

    How they do this and hide all affiliate links behind a JS and urls look :

    pls give me advice how to do this tnx.
     
  2. liveisacode

    liveisacode Newbie

    Joined:
    Apr 8, 2015
    Messages:
    47
    Likes Received:
    1
    Occupation:
    Web Programmer freelance
    Location:
    France
    Why not putting your links in a database, making a post request with the normal link -> obtain the associated affiliate link and then redirect to it. (jquery -> add a .whaterverclass to each link, preventDefaut, the gets associated link, then redirect)
     
  3. dziadekx

    dziadekx Newbie

    Joined:
    Feb 20, 2010
    Messages:
    15
    Likes Received:
    1
    This links are from external API so you don't know what is coming to your site
     
  4. liveisacode

    liveisacode Newbie

    Joined:
    Apr 8, 2015
    Messages:
    47
    Likes Received:
    1
    Occupation:
    Web Programmer freelance
    Location:
    France
    well even better, just make a .post{site: "urlsite"} to a php scripts getting the associated affiliate url using the api, then return the result and redirect to it.
     
  5. liveisacode

    liveisacode Newbie

    Joined:
    Apr 8, 2015
    Messages:
    47
    Likes Received:
    1
    Occupation:
    Web Programmer freelance
    Location:
    France
    will give you an exemple if needed
     
  6. dziadekx

    dziadekx Newbie

    Joined:
    Feb 20, 2010
    Messages:
    15
    Likes Received:
    1
    yes please i will try any solution, i try find a plugin for wordpress (both sites use wodpress) but i don't see nothing.
     
  7. liveisacode

    liveisacode Newbie

    Joined:
    Apr 8, 2015
    Messages:
    47
    Likes Received:
    1
    Occupation:
    Web Programmer freelance
    Location:
    France
    well in your wordpress header you have to load the jquery and the jscript of yourself
    then in your jScript file:


    Code:
    $( document ).ready(function() {
    
        $(".classofyouLinks").click(function(){
    
               $(this).preventDefault(); // Prevent link from working normally
               $link= $(this).attr("href"); // You get the actual link clicked
               $.post( "nameofPHPfileWhichDoesTheRest.php", { link: ""+$link } ); // You sent the link in post format to the file nameofPHPfileWhichDoesTheRest.php         
        });
    
    }
    
    
    
    In the nameofPHPfileWhichDoesTheRest.php file
    
    <?php 
    
    if(isset($_POST['link'])) {  // If data is sent properly
    $link= $_POST['link'] // Get the link value
    
    /*
    Here do the API stuff to get the api affiliate link, as I don't know your api I can't tell you this exactly (Twitter, Facebook etc..) . (See cUrl on github for basic API calls)
    */
    //Then redirect to the link with: 
    location("Header:".$affiateLink."");
    
    }
    
    
    ?>
     
  8. liveisacode

    liveisacode Newbie

    Joined:
    Apr 8, 2015
    Messages:
    47
    Likes Received:
    1
    Occupation:
    Web Programmer freelance
    Location:
    France
    just ask if you need more help
     
  9. dziadekx

    dziadekx Newbie

    Joined:
    Feb 20, 2010
    Messages:
    15
    Likes Received:
    1
    unfortunately I think is to hard for me deal with this and with adultwork api. Is any script or wp plugin to do this.

    tnx for help !
     
  10. liveisacode

    liveisacode Newbie

    Joined:
    Apr 8, 2015
    Messages:
    47
    Likes Received:
    1
    Occupation:
    Web Programmer freelance
    Location:
    France
    well how do you get the new url first? Where is it being storred?