Tech Off Post

Single Post Permalink

View Thread: Passing php variables via "a name" links - Help?
  • User profile image
    evildictait​or

    Browsers dont go back to the server when you give them an internal ("#") link. Even when you think adding get-parameters would work, it often doesn't due to caching, so you can either

    a) Add random data to the end of the link:\
     <a href="mypage.php?important=data&random=ahadhqw#internallink">link</a>
    b) Use javascript nastyness:
    <a href="mypage.php#bob" onclick="getdata('mypage.php')">link</a>

    If your php page returns a constant result (up to arguments) then the caching problem goes away, and you can just use ?get=args#internallink. Note that the ? must come before the #.