Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: $output _blank?

  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    $output _blank?

    Hello,

    I am new to .php and I am confused on how to even add something as simple as a "_blank" to an <a ref="" in order to make an image link open in a new window. There are 2 different sections that I am trying to figure out but they seem like they should work in the same way but I am not sure how to include it. I was hoping someone would be able to at least point me in the right direction on how this would work.

    First section of code:
    if(!empty($instance["ad_0".$i."_image"]) && !empty($instance["ad_0".$i."_url"]))
    {
    $output .= "<li><a href='" . $instance["ad_0".$i."_url"] . "'><img src='" . $instance["ad_0".$i."_image"] . "' alt='Visit' /></a></li>";
    }

    2nd section of code:
    {
    $icon_list .= "&nbsp;<a href='".$value["url"]."'><img src='" . get_bloginfo("template_directory") . "/images/social/" .$value["icon"]."' alt='Social Media Icon' /></a>";
    $count++;
    }

    Any help would be greatly appreciated. Thank you.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,865
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    Code:
    $output .= "<li><a href='" . $instance["ad_0".$i."_url"] . "' target=\"_blank\"><img src='" . $instance["ad_0".$i."_image"] . "' alt='Visit' /></a></li>";
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    neebiephp (03-18-2010)

  • #3
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by abduraooft View Post
    Code:
    $output .= "<li><a href='" . $instance["ad_0".$i."_url"] . "' target=\"_blank\"><img src='" . $instance["ad_0".$i."_image"] . "' alt='Visit' /></a></li>";
    ?
    Thank you very much! When I was fumbling around with the code I wasn't using \. This worked perfectly. Thanks again!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •