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
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
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
I now have a batch of domain name, want to check out the certificate of the domain name expired once.Certificate Expiration Time information can be opened in the browser to view
You do not know what method you can use to obtain the certificate information.
Reply content:
I now have a batch of
Returns the IP address.
gethostbyname Syntax: string gethostbyname (string hostname);
gethostbyname return Value: String
Function Type: Network system
gethostbyname Content Description
This function returns the IP address of a machine name (Domain name). If execution fails, the original machine name is returned.
Us
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
//////////////////////////////////////////////////////////////////////////////
[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
CopyCodeThe Code is as follows: // Obtain the current domain name:
Echo $ _ server ['server _ name'];
// Obtain the source URL, that is, click the previous URL on this page.
Echo $ _ server ["http_referer"];
$ _ Server ['request _ URI ']; // obtain the suffix of the current domain
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.
socket library, it needs to call the wsacleanup function to unbind from the socket library and release the system resources occupied by the socket library.Database functions related to Internet information such as domain names, communication services, and protocols, such
Gethostbyaddr, gethostbyname, gethostname, and getprotolbyname
Getprotolbynumber, getserverbyname, and getservbyport.1. gethostname ()
[Function prototype]
Int Pascal far gethostname
Parse PHP to obtain the implementation code of the current website and domain name. Copy the code as follows :? Obtain the current domain name: echo $ _ SERVER [SERVER_NAME]; obtain the source URL, that is, click the previous page URL echo $ _ SERVER [HTTP_REFERER]; $ _ SERVE
The code is as follows:
// Obtain t
Requirement: Because the target site CDN node many need to get to access the IP at the time.1, implement the interface Httpconnectionmanager new implementation Class A, directly copy the Simplehttpconnectionmanager class content.2. Class A Add methodPublic Socket Getsocket () {return This.httpConnection.getSocket ();}3. Specify Httpconnectionmanager for HttpClientMETHOD specifies Httpclient.sethttpconnectionmanager (new A ()) for httpClient;4, Httpcli
search, I want to use, paste it out, look at the wood has a problem ah! Echo $HTTP _host is the domain name to output!
function pma_getenv ($var _name) {
if (isset ($_server [$var _name]) {
return $_server [$var _name];
} elseif (Isset ($_env [$var _name]) {
return $_env [$var _name];
} elseif (getenv ($var _name)) {
return getenv ($var _name);
This article describes how to obtain a domain name in js, and describes how to use common methods in window. location. if you want to obtain a domain name, refer to the example in this article. Share it with you for your reference. The specific implementation method is as follows:
The code is as follows:
Script/
An alternative to the Parse_url () function seen on the official web site of PHP. The result is similar to the Parse_url () function, and is implemented using a regular.URIs are every resource available on the Web-HTML documents, images, video clips, programs, and so on-positioned by a common resource identifier (Uniform Resource Identifier, referred to as the "URI"). Group objects:^(([^:/?#]+):)? (//([^/?#]*))? ([^?#]*) (\? ([^#]*))? (# (. *))? 3 4 5 6 7 8 9Th
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.