jnerotrix Posted January 20, 2009 Share Posted January 20, 2009 Heres The Code I Have <?php $ip = $_SERVER['REMOTE_ADDR']; //Checks Ip $myFile = "ip.txt"; $lines = file($myFile); $lines = array_map('trim',$lines); if(!in_array($ip,$lines)){ $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$ip\r\n"; fwrite($fh, $stringData); fclose($fh); } $file = "ip.txt"; $users = count(file($file)); echo "We Have Had $users users Visit This Site"; ?> I need it so - - - if $users = 1000 then do command else do other command so it would look like this i just dont know how to code it <?php if ($users equals 1000 { echo "you are the 1000 User To Visit this Site"; } else { echo "Welcome to My Website"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/141632-if-number-number-help/ Share on other sites More sharing options...
Maq Posted January 20, 2009 Share Posted January 20, 2009 if ($users == 1000) { echo "you are the 1000 User To Visit this Site"; } else { echo "Welcome to My Website"; } ? Quote Link to comment https://forums.phpfreaks.com/topic/141632-if-number-number-help/#findComment-741368 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.