Page 1 of 1

getting a href anchor to work

Posted: Wed Oct 08, 2003 10:12 am
by mesz
snippet of large php script

Code: Select all

<?php
echo "<a class="fab_blue_small" 
href=".//gallery_ms/forumesque/view.php#$caption"
onMouseOver="window.status=''; return true" target="blank"> 
view specifications & more info 
</a>";
?>
code at view.php

Code: Select all

<?php

  echo "<form class="form2"><b><a href="#$pieces[1]  ">" .     $pieces[1] . "</a></b><br>" . $pieces[3]. 

"<br>" ; 
    echo " d e t a i l s - <br>" . $pieces[2] .  "<br>" .  "<small>info updated on ".$pieces[0] ."</small></form>"  ; 
?>
However viewer does not link to correct anchored position.
Client simply links to top of the page.
How do I get the anchor to work.

Posted: Wed Oct 08, 2003 10:23 am
by Wayne
where is you anchor point

Code: Select all

<a name="anchor_name">
in view.php

Posted: Wed Oct 08, 2003 10:28 am
by mesz
"<form class=\"form2\"><b><a href=\"#$pieces[1] \">" . $pieces[1] . "</a></b><br>"
here.

Posted: Wed Oct 08, 2003 10:45 am
by Nay
No, I think you do know that they're two parts to it. One, where you click and Two, where to goes.

One, where you click:

Code: Select all

<a href="#foo">foo</a>
Two, where it goes:

Code: Select all

<a name="foo">
This is where foo is in the page, you have come here since you clicked foo somewhere else in the page.
</a>
So we're wondering where did you put the <a name="">?

-Nay

Posted: Wed Oct 08, 2003 11:01 am
by mesz
I am an idiot ! I forgot the most basic things whilst getting bogged down in all this programming malarkey

Posted: Wed Oct 08, 2003 11:20 am
by mesz
all working. I really did forget to replace href with name, doh!
Cheers y'all.