Jump to content

a humble inquiry regarding IP addresses


stirk

Recommended Posts

I have basic knowledge of PHP syntax and thats about it. anyway... say i have x amount of people coming to a webpage. i want about 20% of the users to see a certain message. how can i accomplish this? I was thinking about using their IP address. addresses ending in 0 and 1 see the message 2-9 do not. is this possible? for all i know there is a much simpler solution, but as i said i know virtually nothing of PHP.  :confused: thanks for your time.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/168714-a-humble-inquiry-regarding-ip-addresses/
Share on other sites

that actually would most likely work.  Just remember: 1 is the most common number, 5 is the second most common number. I saw a graph on this, so if you were to calculate based upon the number that has the percentage closest to 20%, you would only need to watch for that number, rather than 2 numbers.  I'm bashing my brain in trying to remember what that graph was called.

ahh awesome. ill look for information regarding the digits. if worse comes to worse ill just do trial and error.

 

now could you just throw me a quick outline of the code i should use? sorry im asking to be spoonfed but itd save me a whole lot of time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.