I'm creating a website where I collect the name, email, state, and an optional photo of a user. Before the user submits the form, they have to agree to the terms of the site. For testing and statistics, i'd like to collect IP address and user agents. Do I have to let the user know i'm gathering this on the terms page? 
Is collecting IP address and user agents on form submission illegal in the U.S.?
legal;ip address;user agent
As paulmorriss mentioned in the comments, most major web servers do this automatically anyways, with their server logs. These logs contain UA strings, IP addresses, and much more.I don't know of any law on the books that would explicitly forbid this, but I would say that you should probably include in the Terms of Service the fact that you collect this information for statistical purposes.