0

I want to pass a query string with anchor tag but it is not working for some odd reason:

This works:

http://www.striplac-southeastasia.com/index.php#contact-form11

This doesnt: http://www.striplac-southeastasia.com/index.php#contact-form11?success=1

Neither does this

http://www.striplac-southeastasia.com/index.php?success=1#contact-form11

Regards Ahmar

Ahmar Ali
  • 930
  • 5
  • 24
  • 47
  • 1
    http://www.striplac-southeastasia.com/index.php?success=1#contact-form11 should work. What's not correct, the anchor "jump" or the value of success? – Grim... Feb 13 '14 at 11:47
  • both are correct. Check the anchor jump without query string. It works – Ahmar Ali Feb 13 '14 at 11:49

1 Answers1

0

The # tag values are not send to server, therefore the URL before # tag is entertained by server.

Hash tags are resolved by browser only.

You can try parse_url() function, it Parse a URL and return its components. This can help you in some case. This return associative array and with the help of Potential keys within this array you can fetch the value. fragment key return the value after the hashmark #.

Visit http://www.php.net/manual/en/function.parse-url.php

I think Can I read the hash portion of the URL on my server-side application (PHP, Ruby, Python, etc.)? might help you to figue things out.

Community
  • 1
  • 1
Rohit Nigam
  • 698
  • 8
  • 23