how can i get the ip address of the user on my email while the user clicks the submit button anyone could help me

Recommended Answers

All 5 Replies


You want the MAC address? That's impossible with PHP. The browser doesn't send that information.

That what magicmedia told to get ip address of PC:-


It will return the ip address of the user connected.....

function get_real_ip_addr(){
		if (!empty($_SERVER['HTTP_CLIENT_IP'])){   //check ip from share internet
		elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){   //to check ip is pass from proxy
		return $ip;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.