There are several ways to get URL address bar parameters:$_server["Server_port"]//get port$_server[' Http_host ']//get the domain name or host address such as www.sina.com or music.sina.com$_server[' server_name ']//get the domain name or host
Get URL address in PHP We have a lot of functions to use, mainly global variable server provides me with a lot of methods, let's take a look at it.
Common functions
The code is as follows
Copy Code
Get domain name or host
How to use JavaScript to get URL parameter examples JavaScript gets url parameter method:
function request (paras)
{
var url = location.href;
var parastring = url.substring (Url.indexof ("?") +1,url.length). Split ("&");
var paraobj = {}
For (i=0
Tomorrow is free to edit underToday do the project encountered JS get URL address question mark after the parameters, find the following, with very good, item is tab style, that is, a click of the two-level classification, the same name below the
[URGENT !] What should I do if I want to use get to get URL variables, but the server prompts that the domain name does not actually exist and cannot be accessed? Http://iqs.ctgu.edu.cn/lost/register.phpaction=activationauth=688fCtlTO5JS+kJAa/Z8vEK+6
JS Get URL Pass parametersHere is a JavaScript client solution that gets the URL with the questring parameter, equivalent to the ASP's request.querystring,php $_getFunction:
Then we get the corresponding parameter value by
JS Get URL Pass parametersHere is a JavaScript client solution that gets the URL with the questring parameter, which is equivalent to the $_get function of the ASP's request.querystring,php:Then we get the corresponding parameter value by calling
The complete URL consists of these parts: Scheme://host:port/path?query#fragment, the various parts are as follows:Window.location.href: The way to get the full URL: scheme://host:port/path?query#fragmentWindow.location.protocol: Get Rul protocol
You can return the URL parameter collection as an object by using the following function.function Getrequest () { var url = location.search;//Get URL in "?" Character string var therequest = new Object (); if (Url.indexof ("?")! =-1) {
JS get url parameter modify URL parameter remove URL parameterfunction Urlhelper () {var obj= {}; //gets the value of the URL parameter: name is the name of the parameterObj.getquerystring =function (name) {var reg=NewRegExp ("(^|&)" + name + "= ([^&
Gets the URL parameter name of the name parametervar getparam = function (name) { var search = Document.location.search; var pattern = new RegExp ("[? &]" +name+ "\= ([^&]+)", "G"); var matcher = pattern.exec (search);
There are many ways to get URL parameters on the Web, and I have added comments to them. Do not know the friend can give me a message1JavaScript gets the Get parameter method (get URL parameter method) in detail
JS get URL parameter value of a lot of methods, the following also for you to introduce two, like friends can test, hope to be helpful to everyonemethod One: The regular analysis MethodThe code is as follows:function getquerystring (name) {var reg =
Two native methods of obtaining parameters via URLs (typically provided using a framework):Method One (recommended):Urlinfo=window.location.href; Gets the URL of the current pagelen=urlinfo.length;//gets the length of the URLOffset=urlinfo.indexof ("
Original address: http://www.cnblogs.com/xiaoxi/p/5695783.html1, directly the parameter of the form is written in the parameters of the controller corresponding method, applicable to the Get method submission, not for post mode submission. /**
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.