SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Wizard nofel's Avatar
    Join Date
    Aug 2007
    Location
    Earth
    Posts
    1,766
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    how to read this php code

    Hi,
    I am new to php and wanted to ask, how to read this code.
    All those who wander aren't lost.

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    412
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Seems to me that if the client IP address is an even number, it redirects to the specified location, otherwise it does not. Post the code here though for more comments.
    http://www.firenza.net - my homage to a car from the 1970s

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,080
    Mentioned
    153 Post(s)
    Tagged
    2 Thread(s)
    ^ What he said

    Looks like either load balancing (send a portion of the visitors to a different server for balanced load among different servers -- although this usually isn't done via php because there are way faster options) or A/B testing.
    Rémon - Hosting Advisor

    SitePoint forums will switch to Discourse soon! Make sure you're ready for it!

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  4. #4
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    66 Post(s)
    Tagged
    2 Thread(s)
    That's interesting, may I ask where you found it?

  5. #5
    SitePoint Wizard TheRedDevil's Avatar
    Join Date
    Sep 2004
    Location
    Norway
    Posts
    1,196
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    That looks like a simple attempt on doing split testing.

    I.e. testing what version of a page converts best.

    Reason for that is simply due to if your "optimistic enough" to try and make a load balancer in PHP, you would not base it on modulus, since that can send all visitors through the day to one of the servers if your unlucky.

    Still an odd way of doing it, since split testing is normally done with round robin, or geo location.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •