Announcement

Collapse
No announcement yet.

Content based by IP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Content based by IP

    I'd like to play an april fools joke on someone.. could I put something in the index.php that if their IP matches, I could have it load a template or another HTML file?

  • #2
    PHP Code:
    $userip 'the IP of the person';
    if (
    $_SERVER['REMOTE_ADDR'] == $userip OR $_SERVER['HTTML_CLIENT_IP'] == $userip)
    {
        
    // this is the person's IP address, so go ahead and do what you want
    }
    else
    {
        
    // this is not the person's IP, so do the normal thing

    That was do the IP detection; if you wanted it in a vB file, like index.php, you should go over to vB.org for help.
    Bugdar: PHP bug tracking software that is beautiful, fast, and robust.

    Comment


    • #3
      Thank you very much Daemon..
      I've asked at vB.org and I left a message giving you credit for the code there, because obviously I didn't come up with it myself.

      Thanks again for helping, and have a great day.

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X