我只想在參數中獲取URL字符串。 所以我下面的編碼:如何在PHP中獲取整個URL字符串(包括&,?)?
//In my HTML file.
<script>
document.write('<iframe id="ifr1"
src="http://{domain}/prj.php?url=https://www.google.co.kr/search?sugexp=chrome,mod=3&sourceid=chrome&ie=UTF-8&q=url+utf8+encoding#sclient=psy-ab&hl=ko&newwindow=1&prmdo=1&tbm=klg&q=google&oq=google&aq=f&aqi=g10&aql=&gs_l=serp.3..0l10.2207859.2208404.3.2208459.6.4.0.1.1.3.496.1353.2-2j1j1.4.0...0.0.O1lbexylHQM&pbx=1&prmdo=1&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=b8fee9fdb4e7f90&biw=1440&bih=828&a=' +'asdf'+" width="100%" height="100%" frameborder="0"> </iframe>');
</script>
//In my php file
$message = $_GET['url'];
echo("$message");
但我只得到 'https://www.google.co.kr/search?sugexp=chrome,mod=3'。
怎麼了?
我想獲取整個URL字符串。包括&,?或其他一切。
Downvoted,因爲我覺得這是不正確的,這取決於上下文。如果有動力,我願意討論這個問題並取消downvote。 – Cranio