1

How can I read last part (after slash) of url if my url is like this:

http://testWeb.com/eng/pay-online/#__hc-action-complete--9d79883508

I've tried with $_GET and $_POST but these are empty. Also I've tried using $_SERVER['REQUEST_URI'] but it also return url till "pay-online". The project is in wordpress (in case there is something in WP which can solve this).

6
  • you could get the whole url and then split the string based on a regular expression Commented Mar 27, 2017 at 13:48
  • 3
    The fragment (bit after the #) doesn't get sent to the server. Commented Mar 27, 2017 at 13:49
  • @JonStirling in that case how can we get this last part? Commented Mar 27, 2017 at 13:52
  • get this last part? you have to manipulate the uri to send the # ancor-part as real paramter with javascript. like http://testWeb.com/eng/pay-online/?ancor=__hc-action-complete--9d79883508 Commented Mar 27, 2017 at 13:54
  • 1
    I suppose you could do it with JavaScript. Commented Mar 27, 2017 at 13:54

1 Answer 1

1

You can obtain the fragment using JS like: var fragment = location.hash.substring(1); // minus the hash

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.