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

How to do this in javascript/php?

Discussion in 'Black Hat SEO' started by thizzladen, Mar 15, 2012.

  1. thizzladen

    thizzladen Power Member

    Joined:
    Jul 11, 2009
    Messages:
    591
    Likes Received:
    450
    Occupation:
    Doing whatever bakes the cake.
    Location:
    In house. With television and remote control.
    I'm trying to show a certain link on my status bar and when the person clicks it it goes to a different one.

    The code I've put so far is this:

    Code:
     <script language="javascript" type="text/javascript">
         function redirect(URL)
         {
           document.location=URL;
           return false;
         }
        </script>
    
    <center><h2><a href="http://www.showthislink.org/download/<?php the_title(); ?>.zip" onclick="return
    redirect('http://www.gotothislink.com') rel="nofollow"><font color="FF0000"> Click Here to Download <?php the_title(); ?></font></center></a></h2>
    This is how it looks on my single.php page in wordpress.

    I dont know much about coding, I just search google and read about code that I want to to use. Do I have to put any special code on the top of the page to let it know that I'll be using javascript later?


    I got the code above from this site:
    Code:
    http://roshanbh.com.np/2008/08/different-status-bar-text-hyperlink-mouseover.html
     
    Last edited: Mar 15, 2012
  2. cashmaster

    cashmaster Junior Member

    Joined:
    Dec 25, 2010
    Messages:
    146
    Likes Received:
    17
    Years here in BHW, and yet you do not know where to post a thread ?

    As for your query, if the code that you have given, is between php tags, then you need to place it in echo. Else, this will do. BY looking at it, there is no php tags around the entire code, so you are safe to use like this.
     
  3. thizzladen

    thizzladen Power Member

    Joined:
    Jul 11, 2009
    Messages:
    591
    Likes Received:
    450
    Occupation:
    Doing whatever bakes the cake.
    Location:
    In house. With television and remote control.
    Lol, forgot we had a cloaking section xD


    At the top of the page there IS php tags :O
    So I guess I DO have to add echos. Do I add them to the PHP part or JS part of the code?
     
  4. kitteh101

    kitteh101 Regular Member

    Joined:
    Jan 17, 2012
    Messages:
    363
    Likes Received:
    53
    Occupation:
    Consultant
    Location:
    International
    Hey man sometimes we post in the black hat seo section because it always has the most people viewing it = more replies faster.......... I try not to do this too lol but considering im online almost every waking moment, i see little things like this that might result in faster reply to question = increased productivity LOLL
     
  5. zackm

    zackm Junior Member

    Joined:
    Dec 11, 2010
    Messages:
    145
    Likes Received:
    26
    Code:
    <a href="http://www.google.com/" onclick="javascript:this.href='http://www.yahoo.com'">Google</a>
    :)
     
    • Thanks Thanks x 1
  6. thizzladen

    thizzladen Power Member

    Joined:
    Jul 11, 2009
    Messages:
    591
    Likes Received:
    450
    Occupation:
    Doing whatever bakes the cake.
    Location:
    In house. With television and remote control.
    Works like a charm, much appreciated!
    Didn't know it was so simple :D