user3094342
user3094342

Reputation: 21

How to get full url along with # symbol in php

I am using AngularJS routing with php, so that my urls look like

http://localhost/admin/home#/categories

When ever I am trying to get url it wont gave full url. It gives only /admin/home.

I am using $_SERVER['REQUEST_URI'] and codeigniter segment. Both are not working.

Can any one help?

Upvotes: 2

Views: 489

Answers (2)

KJS
KJS

Reputation: 1214

use:

$_SERVER[PHP_SELF] 

It will give the full url, including everything.

If you want to strip stuff from the url, use things like this:

$url = trim(strtok("$url", '?'));
$url = str_replace("#!/", "", "$url");

Upvotes: 0

masitko
masitko

Reputation: 609

This information is not being past to the server I'm afraid. The url part after # is only for browser use. You can add GET or POST parameters to pass this information to your server like:

http://localhost/admin/home?hash=categories#/categories

Upvotes: 1

Related Questions