Today I would like to introduce you two JS to get the current domain name
The code is as follows
Copy Code
Get the current domain name1, Window.location.host;2, Document.domain;Get current page address
Today I would like to introduce you two JS to get the current domain name
The code is as followsGet the current domain name
1, Window.location.host;2, Document.domain;
Get current page address
url = window.location.href;
Exam
JS gets the current URL1, sets or gets the file name or path specified by the object.Alert (Window.location.pathname)2, sets or gets the entire URL as a string.alert (WINDOW.LOCATION.HREF);3, set or get the port number associated with the URL.Alert (Window.location.port)4, set or get the protocol portion of the URL.Alert (Window.location.protocol)5, set or
Is it possible to get a first-level domain name code for each type of URL?
This post was last edited by Changjay on 2010-09-07 23:25:30
There are many URLs, like abc.abc.com, Abc.com/abc, www.abc.com.cn, abc.com.tw, www.abc.co.uk, WWW.ABC.COM.JP/ABC.PHP/ID=ABC (id= It can be long after ABC)
There are a lot of things that I hope can be omnipotent.
How do I
This article mainly introduces how PHP obtains the current host, domain name, url, path, port and other parameters, has a certain reference value, interested can understand the next
Lab Environment:
Test the domain name Daxiangtravel.com,apache root directory/mnt/, test the directory/mnt/qa/test, the test file is name
Example Document.domain
The code is as follows
Copy Code
Method Two, using the URL to resolve the domain name
The code is as follows
Copy Code
How to use:
The code is as follows
Copy Code
Add
4 ways to get the current URL
var url = window.locati
How to get the domain name via IP??
I use GETHOSTBYADDR (' inside put IP '), every time only return IP instead of return domain name, seemingly only input 127.0.0.1 can return domain name
Ping a network remote host by inetaddress and get the IP address of the domain name
Import java.io.IOException;
Import java.net.InetAddress;
Import java.net.UnknownHostException;
public class Pingutils {
/**
* Obtains this domain name by
Ec (2); php tutorial to get the current url domain name instance code nbsp; functiongetServerName () nbsp ;{ nbsp; nbsp; $ ServerNamestrtolower ($ _ SERVER [SERVER_NAME]? $ _ SERVER [SERVER_NAME]: $ _ SERVER [HTTP_HOST]); nbsp; I script ec (2); script
Php tutorial to get the current url
If you want to register a domain name, we recommend that you use xinnet. Because the application fee is really low, but the renewal price is still relatively high, it is best to apply for more than a few years. Open the Website: http://www.xinnet.com/register an account, and then apply for a domain name, you can see th
PHP Extra-Curricular notes-How to get a domain name There are several ways to get a domain name in the PHP training note:Method one (with system variables)Disadvantages do not use passed-over addresses and hosts that do not suppor
#region get the ad user name and the OU directory based on the current logged-in domain account///Get the ad user name and the OU directory based on your current login domain account
I want to use PHP $_server[' http_host ' to get the domain name of the current server, but each time it is converted to an IP address?
Reply content:
I want to use PHP $_server[' http_host ' to get the domain name of the curr
string "") + context. Request.applicationpath;The output of this sentence can be obtained by the address such as: http://localhost:25138/such a domain name is composed of two parts, where "/" This is byContext. Request.applicationpath; the output is meant to get the virtual application root path of an ASP. NET application on the server.The way to
The 1.ping command returns a public network IP address, but this IP address is inconsistent with the current public network IP of the machine where the peanut shell client is located
For example Ping ping-is-no-good.gicp.net, the IP returned is 59.37.71.85, as shown in the following figure:
And the current peanut shell log in computer through the router Internet, the router's WAN IP is 121.32.186.189, that is, peanut shell log in this computer's public network IP is 121.32.186.189.
//////////////////////////////////////////////////////////////////////////////
[MDaemon] Get MD domain list with ASP
Original Author: Jia Jun (Jaron)
Website: http://www.jiangdu.net;
Mail: jaron@jdinfo.net
First published in Jiangdu Information Network, 2003-01-12
//////////////////////////////////////////////////////////////////////////////
' Domain.asp
'/////////////
DIM Omduser
DIM Domains
Dim Domainname
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.