Re-Write the URL using $_SESSION vars

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    Re-Write the URL using $_SESSION vars

    Hi,

    I have been working on site for the last month and in terms of tech development it's now done, I'm waiting for final content.

    While I wait I am playing around with some other ideas.

    Each page on this site is loaded through AJAX so the URL never changes. However, if the URL contains two parameters then a specific page is loaded when the site boots up. This enables me to send out page specific links.

    Every time a new 'page' is loaded two $_SESSION variables are updated to store the ID's that would be needed to get teh relevant page information from the DB. It would great if I could then write those to the URL so that bookmarking and browser history become available.

    The trick is that I don't want to refresh the page to do this - that would defeat the point of having done this using AJAX.

    Does anyone have any suggestions? I have spent a lot of time reading around on this subject and I have found nothing that has made much sens to me.

    Well now I've asked my question I best go see if there's a question or two I can answer.

    Cheers
    nathj
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    Sounds to me like you need JavaScript to edit the URL the browser is displaying?
    That's more of a JavaScript thing, so I'll move this over to the JavaScript forum.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      You could try using the location.hash property.

      There are some implementations , e.g. RSH (Really Simple History). You may also find this link useful.

      Comment

      • nathj
        Recognized Expert Contributor
        • May 2007
        • 937

        #4
        Originally posted by acoder
        You could try using the location.hash property.

        There are some implementations , e.g. RSH (Really Simple History). You may also find this link useful.
        Hi,

        Thanks for the pointers. I had started playing around with the # idea - this at least allows bookmarking before any more advanced modifications to allow the back button to function.

        Cheers
        nathj

        Comment

        Working...