nezbo Posted January 10, 2008 Share Posted January 10, 2008 Hi all I have some code and i can get it to work :'( i am trying to get the system to auto generate a if string, bellow is the code, i can get it to display the $IPS but the systems keeps passing through the if statment. if ($_SERVER["HTTP_X_FORWARDED_FOR"] != "") { $IP = $_SERVER["HTTP_X_FORWARDED_FOR"]; $proxy = $_SERVER["REMOTE_ADDR"]; $host = @gethostbyaddr($_SERVER["HTTP_X_FORWARDED_FOR"]); } else { $IP = $_SERVER["REMOTE_ADDR"]; $host = @gethostbyaddr($_SERVER["REMOTE_ADDR"]); } if (!$_POST['datestamp'] and !$_REQUEST['d']) { $mkDateHell = mktime(); $dateHell = date("d/m/Y", $mkDateHell); $_REQUEST['d'] = $dateHell; } $getIPS = mysql_query("SELECT * FROM ipaddresses WHERE valid = 0"); while ($getIPS2 = mysql_fetch_array($getIPS)) { $IPS = $IPS . " or (". $getIPS2['ipAddress'] . " == " . $IP . ")"; } echo $IPS; if ((validate(16) == 1) . $IPS) { Quote Link to comment Share on other sites More sharing options...
nezbo Posted January 10, 2008 Author Share Posted January 10, 2008 it's ok i have solved it, but it would be intresting to find out why i cant put a string in a if statment. here is the new dit of code :: $getIPS = mysql_query("SELECT ipAddress FROM ipaddresses WHERE valid = 0 and ipAddress = '$IP'"); $ipCount = mysql_num_rows($getIPS); if ((validate(16) == 1) or ($ipCount > '0')) Quote Link to comment 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.