Here I would like to summarize some of the information that gets the URL in the address bar and my path to the file that it belongs to:Using $_server[] We can do a lot of things: it's an array of headers (headers), path information, and script
Sometimes we need to get the url of the current webpage for our judgment. Generally, we use location. href to get the js url link string: location. href
It can be intercepted to obtain the transmission parameters, which are commonly used as
Httpcontext. Current. Request. url. tostring () is not reliable.If the current URL isHTTP://Localhost/search. aspx? User =Http://csharp.xdowns.com& Tag = % BC % Ca % F5Obtained Through httpcontext. Current. Request. url. tostring ()
This article describes how to use Javascript to obtain the parameter code instance in a URL like PHP $ _ GET. For more information, see
The Code is as follows:
/* Obtain the GET parameter in the address bar like $ _ GET ['arg '] in PHP
As efficiently as possible, remove the file extension from a standard URL and extend the code to get other data, such as the directory path, which is the principle of using PHP's explode function to separate strings.
For example:
$ _ GET method cannot GET the url value. my code is like this.
Jq
$ ('# Add_user'). ajaxSubmit ({
Url: ThinkPHP ['module'] + '/User/add ',
Type: 'post ',
Success: function (data ){
Alert (data );
Var top = (screen. height-500)/2;
Var left =
1.
and place this code on any webpage to see the effect test parameter: untitled.html? A = aaaaa & B = bbbbbbbbbb & c = dddddddd output result: 1st parameters> name: a value: aaaaa 2nd parameters> name: B value: bbbbbbbb 3rd parameters> name: c
There are many writing methods on the Internet, which are just one of them. This function is used to obtain the value of a specified parameter. You can expand multiple values by yourself.
Function:
Function
Querystring (key ){
VaR
URL:Unified Resource Locator(Uniform Resource Locator, URL)CompleteURLIt consists of the following parts:Scheme: // host: Port/path? Query # Fragment
Scheme =Communication Protocol ( Common HTTP, FTP, Maito And so on )Host = Host ( Domain
Php obtains the url address and summarizes some functions. Many functions can be used to obtain url addresses in php. The global variable server provides me with many methods. let's take a look. The common function code is as follows: copy and
This article introduces how to use the get method when submitting a form. then, we get garbled characters using get, let's take a look at how to solve this problem. The code is as follows: ahrefquot; l... this article introduces how to use the get
Browse address: http://ajax.googleapis.com/ajax/services/language/translate? V = 1.0 & Q = Google, I Love You & langpair = EN % 7czh-cn
Directly browse the returned source code:{"Responsedata": {"translatedtext": "Google, I Love You"},
Daniel, what do you do?
Rookie thinks
Htacess The only downside is that the server environment does not support Htacess is dumbfounded win system more trouble
Regular fetch, the time to call is more troublesome
Like a URL
PHP's predefined variable, $_server, is an array of headers (headers), path information, and the location of the script, and the entity of the array is created by the Web server.
Using the $_server array, we can get the URL full path and the real
1. Set or retrieve the entire URL as a string:Window. location. href2. Set or obtain the port number associated with the URL:Window. location. port3. Set or obtain the URL protocol sectionWindow. location. protocol4. Set or obtain the Section
First of all: the originalQuick tip:get URL Parameters with JavaScript function Getallurlparams (URL) {var queryString = URL? url.split ('? ') [1]: Window.location.search.slice (1); var obj = {}; if (queryString)
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.