Author Topic: help with links and logic  (Read 208 times)

0 Members and 1 Guest are viewing this topic.

Offline gammamanTopic starter

  • Enthusiast
  • Posts: 131
    • View Profile
help with links and logic
« on: February 08, 2010, 07:46:59 PM »
Ok this is somewhat confusing but I will try to make the best of it.

I have these two html pages inside php includes that appear and go away under certain condi
tions.


one of those pages is just la long list with a bunch of <a#> tags.  And is displayed by default.

So if I was on the main page I would see this long list on the right and on the left I would click a link say "K"
 and so the page would jump down on the list to where #K is, changing the address of the page from
abc.htm to  abc.htm#K.

Now say I want to do something else.  I click a different link.  An href that looks like this.
<a href=abc.htm?name=test>test</a>

I have some php code that says as long as $_GET is NOT SET.  It loads the long list above, which of course happens by default when $_GET does not yet exist.  I continue the php code to say  if it is set, say for example

else if ($_GET[ 'name'])=='test') include "xyz.htm")

this will take away that long list and put the new page in its place. 

This will now change the link from abc.htm#K  to  abc.htm?test.

 But  what happens if I click  one of the anchor links on the left again.  Say K.

Now instead of the page being  abc.htm#K  it  is   abc.htm?test#K.  In effect it still loads the list but  the content from the else if  include above      ,  xyz.htm  is still on the page.   

Offline teamatomic

  • Devotee
  • Posts: 1,197
  • Gender: Male
  • fat skis rule!
    • View Profile
    • myPHPtemplate
Re: help with links and logic
« Reply #1 on: February 08, 2010, 08:37:28 PM »
Check your code. somewhere you are setting the links as whatever.php?test. Showing the code would help.


HTH
Teamatomic
when in doubt...ski fast
when scared...ski faster
when terrified...point em down