By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Re-Write the URL using $_SESSION vars

nathj
Expert 100+
P: 938
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
Jul 23 '08 #1
Share this Question
Share on Google+
3 Replies


Atli
Expert 5K+
P: 5,058
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.
Jul 23 '08 #2

acoder
Expert Mod 15k+
P: 16,027
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.
Jul 29 '08 #3

nathj
Expert 100+
P: 938
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
Jul 29 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.