Jump to content

Recommended Posts

Posted

Ok, I'm sure this is pretty basic staff for everyone who ever wrote anything in PHP (I've only done ASP myself, never PHP).

what I'm looking for is:

If (IP Address is from Thailand)

load x.html

else

load y.html

Thanks in advance.. :o

Posted

I dunno php at all, but this is basically what u need to write. You will need to know what a TH IP looks like and test these with a case or if stmt. You will prolly need to use the php string functions as well to split the ip string.

$IP = $_SERVER['REMOTE_ADDR'];

if ($IP == "127.0.0.1")

{

header("Location: http://www.url1.com/");

}

else

{

header("Location: http://www.url2.com/");

}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.



×
×
  • Create New...