Hi -
i have a main php page (mainpage.php) which loads another php page within it after clicking a link. (loadedpage.php).
My problem is all of the href links in the loadedpage.php are defaulting to the full url path of the parent page and then tacking the php variables i'm pulling in onto the end of it. In this occassion the variable being pulled from the database is the number 50.
So all of my anchor tags in the loadedpage.php which should just simply be: <a href=#50">, are now appearing as: <a href=http://myhomepage.com/mainpage.php?section=hottopics#50">.
All i want is the '#50'.
Here's an example of how the code looks: <a href="#<?=$htopicid?>">
Any help would be greatly appreciated....i just can't figure this out as to why it's doing it.
Thanks in advance.
href problem
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
<a href="#37">
ENCORE PALISADES</a>
</B></TD></TR><TR><TD style="font-size:10px;color:blue;"><B><a href="#40">
STATE OF THE TOWN-2007</a>
</B></TD></TR><TR><TD style="font-size:10px;color:blue;"><B><a href="#41">
Town of Haverstraw 2007 Summer Concert Series</a>I added the target to the href. i realized when i undid some attempts at trying to fix the problem that i went back to far and removed the target tag.
the problem is when you now click the link the entire page is loading into the iframe and not just jumping to the anchor tag.
sorry about that. thanks for checking into it though!
the problem is when you now click the link the entire page is loading into the iframe and not just jumping to the anchor tag.
sorry about that. thanks for checking into it though!
Fixed it. Turns out once you made me realize that the php was correct i knew there must've been something wrong with the actual link to the iframe which there was.
Here's how I corrected the problem:
<a href="hottopicscontent.php#<?=$htopicid?>" target="ifrm">
i needed to add the page name (hottopicscontent.php) of the iframe and then also target it. Works perfectly!
Thanks feyd for helping me figure this out! Much appreciated!
Here's how I corrected the problem:
<a href="hottopicscontent.php#<?=$htopicid?>" target="ifrm">
i needed to add the page name (hottopicscontent.php) of the iframe and then also target it. Works perfectly!
Thanks feyd for helping me figure this out! Much appreciated!