Pourriez-vous me expliquer? Parce que dans les statistiques, je peux trouver des liens Refelar et je suis curieux. Comment sont-ils fabriqués? Est-il placé quelque part dans la requête HTTP?Liens de référence - comment ça marche?
2
A
Répondre
4
Oui, il est disponible par l'en-tête referer
. Notez qu'il s'agit d'un champ facultatif et que sa valeur peut être usurpée par le client manuellement ou par une application côté client comme le font certains firewalls et applications de sécurité Internet (Norton Internet Security est connu dans ce document). De toute évidence, vous ne devez pas vous fier à cette logique métier, mais utilisez-la uniquement pour les statistiques purement.
Comment l'attraper dépend de la langue côté serveur que vous utilisez. En PHP, vous pouvez faire:
$referrer = $_SERVER['HTTP_REFERER'];
En Java/Servlet vous pouvez faire:
String referrer = request.getHeader("referer");
Notez le legendaric au mal orthographié le nom du champ d'en-tête.
Questions connexes
- 1. aspx.designer.cs comment ça marche?
- 2. CSS - Comment ça marche
- 3. PNRP - Comment ça marche?
- 4. UIView, comment ça marche?
- 5. XpsSignatureDefinition.SpotLocation - Comment ça marche?
- 6. Comment ça marche?
- 7. C Tokenizer - Comment ça marche?
- 8. Unity 2.0: Comment ça marche?
- 9. C# Async - Comment ça marche?
- 10. Scrapy BaseSpider: Comment ça marche?
- 11. jQuery Plugin - Comment ça marche?
- 12. Salamander .NET Linker - Comment ça marche?
- 13. Jquery. Pourquoi ça marche?
- 14. msdeploy --- ça marche ou ça craint?
- 15. L'administrateur introspectif de Django: comment ça marche?
- 16. Laplacien de Gaussian: comment ça marche? (OpenCV)
- 17. git - ça marche sur l'image?
- 18. iAd sur iPad, ça marche?
- 19. Sites web d'octroi de licences - Comment ça marche?
- 20. WPF: ComboBox TextSearch, comment ça marche?
- 21. DRUPAL: Module Spamspan ... comment ça marche?
- 22. rails trouver (: tous) faire ... comment ça marche?
- 23. C#: Comment ça marche: Unit myUnit = 5;
- 24. MooTools et Joomla, comment ça marche?
- 25. SAP Background Job: comment ça marche?
- 26. Coulée type C#: comment ça marche?
- 27. IExtension: modèle d'objet extensible: Comment ça marche?
- 28. Macro ARRAYSIZE C++: comment ça marche?
- 29. Routage url mvc. Comment ça marche?
- 30. Android - ClipDrawable, ScaleDrawable, comment ça marche?