How to write login_Url = & quot; 'for an asp program using php to initialize the LoginIPArea = & quot;' login_Url = Request in the client ip region. serverVariables (& quot; HTTP_REFERER & quot;) 'gets a piece of asp program on the client. how should I write it in php?
Login_Url = "" 'initialize the URL
LoginIPArea = "" 'initialize the client ip area
Login_Url = Request. ServerVariables ("HTTP_REFERER ")'
Nextpage = "script location. href = 'p _ center. asp '; script"' defines the page to jump.
'Response. write login_Url
'Response. end
If len (login_Url)> 0 then' source url processing process
Login_Url = replace (login_Url, "http ://","")
Login_Url = split (login_Url ,"/")
Login_Url = login_Url (0)
End if
Isvalid = 1
Validcount = 0
Logincount = 0
Vipurl = request ("vip ")
IP = Request. ServerVariables ("HTTP_X_FORWARDED_FOR") 'get the client ip address
If IP = "" Then IP = Request. ServerVariables ("REMOTE_ADDR") 'IP Address processing
'IP = getIP ()
LoginIPArea = GetIpArea (IP)
------ Solution --------------------
$ Login_Url = ""; // initialize the URL
$ LoginIPArea = ""; // initialize the client ip area
$ Login_Url = $ _ SERVER ["HTTP_REFERER"]; // Obtain the client ip address source address
$ Nextpage = "script location. href = 'p _ center. asp '; script"; // defines the page to jump.
// Echo $ login_Url
// Exit
If (strlen ($ login_Url)> 0) {// process the source url
$ Login_Url = str_replace ("http: //", "", $ login_Url );//
$ Login_Url = explode ("/", $ login_Url );//
$ Login_Url = $ login_Url [0];
}
$ Isvalid = 1;
$ Validcount = 0;
$ Logincount = 0;
$ Vipurl = $ _ GET ["vip"];
$ IP = $ _ SERVER ["HTTP_X_FORWARDED_FOR"]; // 'get the client ip address
If ($ IP = "")
$ IP = $ _ SERVER ["REMOTE_ADDR"]; // 'IP Address processing
// IP = getIP ()
$ LoginIPArea = GetIpArea ($ IP );
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service