Ask coding questions

← Back to all posts
Ip Displayer
GatewayDuckYT

Ok so i want to display someone's ip with out logging it, or giving it to anyone can i do this

Voters
GatewayDuckYT
Comments
hotnewtop
CodingCactus

yes, but only on the frontend, just google something like "how to get user's ip frontend js"

Crosis

@CodingCactus Is it ok if I get peoples ip but hash it first for IP bans? (this way I can't even see their IP)

RahulChoubey1

@CodingCactus frontend vs backend?

CodingCactus

@Crosis yes, as long as the user agrees to this (put it in your site privacy policy)

Crosis

@CodingCactus Ok, thank you!

GatewayDuckYT

@CodingCactus can repl kill me for it?

CodingCactus

@GatewayDuckYT you need to make it extremely clear to the user that it is storing their ip. They must accept it (like agreeing to your privacy policy in which you state that you will use their ip, or pressing a button saying that it will give consent for you to us either ip).