Click to See Complete Forum and Search --> : [RESOLVED] Problem with GET and html anchors


wc74
02-20-2008, 04:11 PM
I am currently redoing my works website, i've decided to use a bit of php.

My problem is this, I have a page which contains a list of links, when a link is clicked php fetches a html file and loads the text into a div located below the link. The links go a fair amount down the page so when you click a link down the page the page reloads and you end up at the top of the page, I decided to try putting anchors in so that when the link is clicked the page should jump to the anchor.

The problem is a little strange, it doesn't occur in firefox only in IE6, and to further that if I click the same link more than once the anchor will actually work.

Anyway here is a link to the page that i'm having the problem with, click on the MEETING TIMES link to see the problem in action.

http://www.werribeecc.net/test/commservices.php

Any help will be very much appreciated, I have spent about 2 hours searching the net to no avail.

benracer
02-20-2008, 04:37 PM
Hi,
Could you post your php script. It works on meeting times (IE7). Try validating your script.

wc74
02-20-2008, 04:43 PM
The other links haven't been anchored as yet, I tend to try to get one working first then go ahead and code the others. Interesting that it works in IE7 whatever the problem M$ must have fixed it with the release of IE7, I would like to get the problem fixed for IE6 though, I know others including myself that prefer IE6 over IE7. Heres the code.

<p align="left"><a name="meeting"></a><A href="commservices.php?link=times#meeting">MEETING TIMES</A>
<?php
if($link=='times')
{
$name = "commservicestext/meetingtimes.html";
include("striphtml.php");
print("<div class=\"linkclicked\">");
print("</div>");
}
elseif($link=='none')
{
$name = "";
}
?>
</p>

benracer
02-20-2008, 04:50 PM
Try placing your script on a blank page, some people have had problems with JS clashing with the anchors.

jeremyphphaven
02-20-2008, 04:52 PM
Hey dood, this worked in IE6 for me.

wc74
02-20-2008, 04:57 PM
arrrgh, ok now I feel embarrassed. I just changed my resolution to 800 x 600 to make the page longer and it does seem to be working, I may just need to place the anchor a bit lower.

Thank you to everyone that helped. That was a few hours wasted trying to fix a problem that wasn't there hehe.

jeremyphphaven
02-20-2008, 04:58 PM
arrrgh, ok now I feel embarrassed. I just changed my resolution to 800 x 600 to make the page longer and it does seem to be working, I may just need to place the anchor a bit lower.

Thank you to everyone that helped. That was a few hours wasted trying to fix a problem that wasn't there hehe.

LOL - All good!!!

bradgrafelman
02-20-2008, 06:36 PM
Don't forget to mark this thread resolved.