PHP GET ama # kullanarak yerine? =

4 Cevap

$ _GET [] Php, bu bir değişken örneğin arar? Id = değeri kullanarak

Yerine # değerini çağırmak için bir yolu var mı?

4 Cevap

Hayır, url hash kısmı sadece istemci tarafı ve çünkü sunucuya gönderilmez.

When you enter an URL such as http://server.com/dir/file.php?a=1#something in your browser's URL textbox, the browser opens a connection to the server.com and then issues a HTTP command GET /dir/file.php?a=1 HTTP/1.1. This is the only data sent to the server. Hence, the server never gets the #something part, and this means there is no script on server side you could write to read that value.

Benzer soru burada açıklanmıştır: http://stackoverflow.com/questions/317760/how-to-get-url-hash-from-server-side

Javascript aracılığıyla fragmanını alma ve $ _GET içeriklerle fragmanı ile bir ajax isteği göndererek etrafında çalışmak mümkün oldum.

Lütfen tüm davayı bilmeden, tam kapalı olabilir, ancak XMLHttpRequest basit bir GET tipi aracılığıyla sunucuya # şey gönderme imkanı vardır.

Evet bir yolu yoktur. Ben ne yapmak istiyorum düşünüyorum:

$arValues = array_values($_GET);
// whatever else you want to do with the values