I'm not an "expert" on PhP, but the basics of it would be to simply check the IP that is being used while registering with every UserIP registered on the Database, so, (again this won't be PhP based, not even really for any specific language, just something for you to get the idea) there would need to be something like this:
Code:
Function Search ([COLOR="SeaGreen"]Send the IP you receive from the registering User[/COLOR])
[COLOR="DeepSkyBlue"]counter[/COLOR] = [COLOR="Red"]0[/COLOR]
Try
connect_to_database[[COLOR="SeaGreen"]PS_UserData[/COLOR]]
Select * from dbo.Users_Master where UserIp = [COLOR="Red"]Sent_IP[/COLOR]
DataAdapter.SelectCommand = [[COLOR="SeaGreen"]query_from_above[/COLOR]]
DataSet.Clear()
Conection.Open()
DataAdapter.Fill(DataSet, "dbo.Users_Master")
Conection.Close()
If oDataAdapter.Fill(DataSet) > 0 Then
[COLOR="DeepSkyBlue"]counter[/COLOR] = [COLOR="Red"]1[/COLOR]
End If
Return [COLOR="DeepSkyBlue"]counter[/COLOR]
Catch ex As Exception
End Try
End Function
I know it looks weird, I tried to make it simple, but this is what I got. What you are doing here is:
| 1- Starting a function which will receive the IP of the user who is registering an account (up to you on how you will get it) |
| 2- You start a variable (boolean -Yes,No-) counter which is the one who will tell you if you found the IP already on your database. |
| 3- You use a SQL Query to compare that IP from the registering user against the IPs that are stored on your PS_UserData.dbo.Users_Master to try and find a match between them |
| 4- Then you are storing the information you got from it (as boolean) to know if there was or not a match |
| 5- You send back that information, then you will have to code what you are going to show if the IP had a match on your database (The user had already registered an account under that IP) and/or just let that registration go smoothly |
Again, this might look weird, but that is where I would start if I had to do something like this; I am sure that there could be many other ways of doing this, and If i knew PhP properly I would've posted it, but unfortunately I don't know much about PhP