...

View Full Version : $output _blank?



neebiephp
03-18-2010, 06:33 AM
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.

abduraooft
03-18-2010, 08:39 AM
$output .= "<li><a href='" . $instance["ad_0".$i."_url"] . "' target=\"_blank\"><img src='" . $instance["ad_0".$i."_image"] . "' alt='Visit' /></a></li>"; ?

neebiephp
03-18-2010, 10:57 AM
$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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum