Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Syntax Help

  1. #1
    New to the CF scene
    Join Date
    Sep 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax Help

    I am trying to write a function that would validate if an input is an ip address
    so i want to check for example if the format is
    [1-255].[1-255].[1-255].[1-255]:[1-65535]
    ive spent countless hours trying to mess around with lines like
    /^(-){0,1}([0-9]+)(,[0-9][0-9][0-9])*([.][0-9]){0,1}([0-9]*)$/
    but, i don't fully understand it (if you know a tutorial maybe, that would be great)
    Thanks

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Location
    Quebec
    Posts
    261
    Thanks
    6
    Thanked 7 Times in 7 Posts
    why don't you just use
    PHP Code:
    $_SERVER['REMOTE_ADDR']; 
    ?


  •  

    Posting Permissions

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