javascript - sending full address of google to external page -


i use code getting referral address .

<script>ducument.wrtie(document.referrer);</script>  

and work correct google , full url :

http://www.google.com/url?sa=t&rct=j&q=%d8%b7%d8%b1%d8%a7%d8%ad%db%8c%20%d9%85%d8%ac%d9%84%d9%87%20%d8%a7%db%8c%d9%86%d8%aa%d8%b1%d9%86%d8%aa%db%8c%20%d8%b1%d8%af%d8%b2&source=web&cd=4&cad=rja&ved=0ceyqfjad&url=www.mysite.com/1392/02/%d8%b3%d8%a7%d8%ae%d8%aa-%da%a9%d9%88%da%86%da%a9%d8%aa%d8%b1%db%8c%d9%86-%d8%b1%d8%a7%db%8c%d8%a7%d9%86%d9%87-%d9%87%d9%88%d8%b4%d9%85%d9%86%d8%af-%d8%af%d9%86%db%8c%d8%a7-%d8%a8%d8%a7-%d9%86%d8%a7/&ei=nt2kuzlhhsb40ghinocydq&usg=afqjcng9pknl1ubdalnudipnmdqcwhqx_a 

but when send external php page below code

<script src="mysite.com/ntg.php?token=12948&referrer="+document.referrer></script> 

only send address keyword search

http://www.google.com/url?sa=t  

& has special meaning in urls.

if want include data, have encode it.

use the encodeuricomponent javascript function.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -