How to write an asp program using php?

Source: Internet
Author: User
Tags servervariables
How to write login_Url & quot; for an asp program using php to initialize LoginIPArea & quot; initialize login_UrlRequest.ServerVariables (& quot; HTTP_REFERER & quot;) in the client ip area ;) obtain the client ip address nextpage & quot; & lt; script & how to write an asp program using 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 );

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.