网站推广.NET

网站推广.NET

获得URL地址 西瓜影音url地址 迅雷url地址你懂得 视频url地址是什么

来源:互联网

js获得:

top<span>.location</span><span>.href</span>   顶级窗口的地址this<span>.location</span><span>.href</span>  当前窗口的地址

php获得:

<span>#测试网址:     http://localhost/blog/testurl.php?id=5</span><span>//获取域名或主机地址 </span><span>echo</span><span>$_SERVER</span>[<span>'HTTP_HOST'</span>].<span>"<br>"</span>; <span>#localhost</span><span>//获取网页地址 </span><span>echo</span><span>$_SERVER</span>[<span>'PHP_SELF'</span>].<span>"<br>"</span>; <span>#/blog/testurl.php</span><span>//获取网址参数 </span><span>echo</span><span>$_SERVER</span>[<span>"QUERY_STRING"</span>].<span>"<br>"</span>; <span>#id=5</span><span>//获取用户代理 </span><span>echo</span><span>$_SERVER</span>[<span>'HTTP_REFERER'</span>].<span>"<br>"</span>; <span>//获取完整的url</span><span>echo</span><span>'http://'</span>.<span>$_SERVER</span>[<span>'HTTP_HOST'</span>].<span>$_SERVER</span>[<span>'REQUEST_URI'</span>];<span>echo</span><span>'http://'</span>.<span>$_SERVER</span>[<span>'HTTP_HOST'</span>].<span>$_SERVER</span>[<span>'PHP_SELF'</span>].<span>'?'</span>.<span>$_SERVER</span>[<span>'QUERY_STRING'</span>];<span>#http://localhost/blog/testurl.php?id=5</span><span>//包含端口号的完整url</span><span>echo</span><span>'http://'</span>.<span>$_SERVER</span>[<span>'SERVER_NAME'</span>].<span>':'</span>.<span>$_SERVER</span>[<span>"SERVER_PORT"</span>].<span>$_SERVER</span>[<span>"REQUEST_URI"</span>]; <span>#http://localhost:80/blog/testurl.php?id=5</span><span>//只取路径</span><span>$url</span>=<span>'http://'</span>.<span>$_SERVER</span>[<span>'SERVER_NAME'</span>].<span>$_SERVER</span>[<span>"REQUEST_URI"</span>]; <span>echo</span> dirname(<span>$url</span>);<span>#http://localhost/blog</span>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了获得URL地址,包括了url地址方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

视频url地址怎么获取