baraxil Posted April 16, 2007 Share Posted April 16, 2007 How do i make a script like this... In this example the users ip address is 12.123.12.123 -------------------------------- If (user's ip address)=12.123.12.123 Then echo: you are the ip address i chose -------------------------------- In this examplet the users ip address is 33.333.33.333 --------------------------------------------- If (users ip address)=12.123.12.123 Then End script dont do anything --------------------------------------------- can someone do this if its possible Link to comment https://forums.phpfreaks.com/topic/47308-ip-address-display-message/ Share on other sites More sharing options...
per1os Posted April 16, 2007 Share Posted April 16, 2007 <?php if ($_SERVER['REMOTE_ADDR'] == "12.13.42.23") { print "Hey your ip is " . $_SERVER['REMOTE_ADDR']; }else { die("Your IP was not in the loop!"); } ?> Link to comment https://forums.phpfreaks.com/topic/47308-ip-address-display-message/#findComment-230783 Share on other sites More sharing options...
Dragen Posted April 16, 2007 Share Posted April 16, 2007 <?php $ip = 12.123.12.123; if($_SERVER['REMOTE_ADDR'] == $ip){ //code here if IP is 12.123.12.123 } else{ //code is IP isn't 12.123.12.123 } ?> EDIT: ah, you beat me to it Link to comment https://forums.phpfreaks.com/topic/47308-ip-address-display-message/#findComment-230785 Share on other sites More sharing options...
baraxil Posted April 16, 2007 Author Share Posted April 16, 2007 Thanks a lot Link to comment https://forums.phpfreaks.com/topic/47308-ip-address-display-message/#findComment-230789 Share on other sites More sharing options...
Dragen Posted April 16, 2007 Share Posted April 16, 2007 remember to mark as solved! Link to comment https://forums.phpfreaks.com/topic/47308-ip-address-display-message/#findComment-230800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.