Hi,
I'm using this in a small php script:
$url[1]="http://www.domain.com";
I would like to add target=blank
I tried several ways but could not get it to work.
Does someone know how i could get it done?
Thanks
target=blank
Moderator: General Moderators
- AVATAr
- Forum Regular
- Posts: 524
- Joined: Tue Jul 16, 2002 4:19 pm
- Location: Uruguay -- Montevideo
- Contact:
you have to use the "blank" in the "<a href" like this
$url[1]="http://www.domain.com";
echo '<a href="'.$url[1].'" target=_blank>url</a>';
$url[1]="http://www.domain.com";
echo '<a href="'.$url[1].'" target=_blank>url</a>';
function img() {
//#### CHANGE THESE VARS TO SUIT ####
//#### START OF CUSTOMISATION ####
$adfile="img.txt";
$ad[1]="ads/img1.jpg";
$ad[]="ads/img2.jpg";
$url[1]="http://www.domain.com";
$url[]="http://www.domain.com";
$alt[1]="";
$alt[]="";
//#### END OF CUSTOMISATION ####
//#### DO NOT ALTER CODE BELOW ####
$addata=file($adfile);
$lastshown=str_replace("\n","",$lastshown);
$lastshown=str_replace("\r","",$lastshown);
$lastshown=$addata[1];
$adtotal=count($ad);
$adtoshow=1;
if($lastshown<$adtotal) {
$adtoshow=$lastshown+1;
}
//update, implode and write to file
$addata[0]="Last ad Shown - Ad Rote8\n";
$addata[1]=$adtoshow."\n";
$text=implode("",$addata);
$fp=fopen($adfile,"w");
fwrite($fp,$text);
fclose($fp);
$html="<a href='$url[$adtoshow]' target='_top'>";
$html.="<img src='$ad[$adtoshow]' alt='$alt[$adtoshow]' border=0>";
$html.="</a>";
echo $html;
return;
}
I would like to ad target ="blank"
$url[1]="http://www.domain.com";
and galleryimg="no"
$ad[1]="ads/img1.jpg";
//#### CHANGE THESE VARS TO SUIT ####
//#### START OF CUSTOMISATION ####
$adfile="img.txt";
$ad[1]="ads/img1.jpg";
$ad[]="ads/img2.jpg";
$url[1]="http://www.domain.com";
$url[]="http://www.domain.com";
$alt[1]="";
$alt[]="";
//#### END OF CUSTOMISATION ####
//#### DO NOT ALTER CODE BELOW ####
$addata=file($adfile);
$lastshown=str_replace("\n","",$lastshown);
$lastshown=str_replace("\r","",$lastshown);
$lastshown=$addata[1];
$adtotal=count($ad);
$adtoshow=1;
if($lastshown<$adtotal) {
$adtoshow=$lastshown+1;
}
//update, implode and write to file
$addata[0]="Last ad Shown - Ad Rote8\n";
$addata[1]=$adtoshow."\n";
$text=implode("",$addata);
$fp=fopen($adfile,"w");
fwrite($fp,$text);
fclose($fp);
$html="<a href='$url[$adtoshow]' target='_top'>";
$html.="<img src='$ad[$adtoshow]' alt='$alt[$adtoshow]' border=0>";
$html.="</a>";
echo $html;
return;
}
I would like to ad target ="blank"
$url[1]="http://www.domain.com";
and galleryimg="no"
$ad[1]="ads/img1.jpg";
-
Tubbietoeter
- Forum Contributor
- Posts: 149
- Joined: Fri Mar 14, 2003 2:41 am
- Location: Germany
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
If you want all links to have this attribute then simply change:
to
Mac
Code: Select all
$html="<a href='$url[$adtoshow]' target='_top'>";Code: Select all
$html="<a href='$url[$adtoshow]' target='_blank'>";