Welcome Guest, Not a member yet? Register   Sign In
anchor target
#1

[eluser]Mainboard[/eluser]
hey, i want to know how i can to add the target in the anchor function, i have this

Code:
$html_out .= "\t\t\t".'<li>'.'<a name='.$title.' id='.$id.' target='.$target.'><span>'.$title.'<span></a>';

and i want to add the attribute target in this line

Code:
$html_out .= "\t\t\t".'<li>'.anchor($url.' '. $this->class_parent, '<span>'.$title.'</span>');

a read the function and i know that i need to add the attributes at the end, but doesn't work, i think that is problem for the sintax that i have
#2

[eluser]rwestergren[/eluser]
Attributes should be passed as the third parameter.

Code:
$html_out .= "\t\t\t".'<li>'.anchor($url.' '. $this->class_parent, '<span>'.$title.'</span>', 'target=\"_blank\"');
#3

[eluser]Mainboard[/eluser]
thanks, but, i put to this way because $target is variable that i caching in my db
Code:
$html_out .= "\t\t\t".'<li>'.anchor($url,  '<span>'.$title.'</span>', $target);
but doesn't works because the target don't recognizes the string that i caching in the db, the target call me one main that i use in a iframe to reload one html page in other html page, but the first line that i put in the first post it works, so i need to use the anchor function for security reasons
#4

[eluser]Aken[/eluser]
Code:
$html_out = "\t\t\t".'<li>'.anchor($url.' '. $this->class_parent, '<span>'.$title.'</span>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"');




Theme © iAndrew 2016 - Forum software by © MyBB