1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help simple href problem

Discussion in 'HTML & Website Design' started by irule272, Jul 21, 2009.

  1. #1
    Hello I don't where to insert target="_blank" on this code so that the links will appear in new window. Can someone pls help me insert it.

    Here's the code

    <a href=\"http://twitter.com/". $tweet->screen_name ."\">
    Code (markup):
    Thanks!
     
    irule272, Jul 21, 2009 IP
  2. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #2
    That looks like it's in an echo command so you may need to escape the quotes. Try something like this:
    <a href=\"http://twitter.com/". $tweet->screen_name ."\" target=\"_blank\">
    Code (markup):
     
    qazu, Jul 21, 2009 IP
    NewTier likes this.
  3. irule272

    irule272 Well-Known Member

    Messages:
    1,153
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    155
    #3
    thanks gazu.. still have problem on this one

    can you or someone pls fix it for me... thanks!
     
    irule272, Jul 21, 2009 IP
  4. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #4
    In PHP the . (dot) is a concatenator meaning it joins strings of text. So I'd guess they shouldn't be in this href. Maybe try the following:
    <a href=\" $tweet->permalink() \" class=\"permalink\">
    Code (markup):
    I'm not a PHP expert so I might be wrong :eek:
     
    qazu, Jul 21, 2009 IP
  5. irule272

    irule272 Well-Known Member

    Messages:
    1,153
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    155
    #5
    gazu where is target=_blank on the code?
     
    irule272, Jul 21, 2009 IP
  6. qazu

    qazu Well-Known Member

    Messages:
    1,834
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    165
    #6
    Oh sorry, I didn't know you needed target=_blank in there as well :p
    <a href=\" $tweet->permalink() \" class=\"permalink\" target=\"_blank\">
    Code (markup):
    Hope that works :)
     
    qazu, Jul 21, 2009 IP
    irule272 likes this.
  7. irule272

    irule272 Well-Known Member

    Messages:
    1,153
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    155
    #7
    Ok solved! Thanks gazu! Repped!
     
    irule272, Jul 21, 2009 IP