Hailwood
Hailwood

Reputation: 92581

Capturing hash(#) from URL in CodeIgniter

I have a url that looks like

mysite.com/transactions/view/123456

which works fine.

however my client now wishes to have a hashbang in the url

mysite.com/transactions/view/#123456

Now the obvious issue here is that browsers treat the hashbang as an anchor directive.

Is there anyway to in code igniter allow the hashbang and have #123456 (or even just 123456) passed to the view function?

Upvotes: 2

Views: 3935

Answers (1)

Frank Farmer
Frank Farmer

Reputation: 39356

Is there anyway to in code igniter allow the hashbang and have #123456 (or even just 123456) passed to the view function?

Short of javascript, no. The browser simply doesn't send the 'fragment' portion of the URL to the server. PHP can only read it if javascript running after the page has rendered sends it in a second request.

Upvotes: 8

Related Questions