How do I get a users ip in php?
How do I get a users ip in php?
Then use the $ip variable for what ever you want to do.PHP Code:$ip = $_SERVER['REMOTE_ADDR'];
i want to php include on my website though? how do i make it into a file?
Lol, say i have index.php and I want to include a file say ip.php what do I put in the ip.php file to make it show on my index.php page?
Ive tryed that but dont work :S www.habboinfo.co.uk its jsut blank :S
Because you have no content in your ip.php file?Ive tryed that but dont work :S www.habboinfo.co.uk its jsut blank :S
By looking at your site i'm guessing you want to show their actual ip, this is done by echoing it out.
PHP Code:<?php $ip = $_SERVER['REMOTE_ADDR'];
echo ("$ip"); ?>
thank you! works now +rep
Want to hide these adverts? Register an account for free!