Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Avice_Klausimai

Parašė avice· 2010 Lie. 27 16:07:11
#60

as darau stai ka:
<?php

$con = mysql_connect("localhost","root","SLAPTA");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("ip", $con);

$result = mysql_query("SELECT * FROM ip");

while($row = mysql_fetch_array($result))
  {
  $ip = '$row[ip]';
$allowed_ip = array($ip);   
}
 //populate the array with allowed IP Addresses
   $ipaddress = $_SERVER['REMOTE_ADDR'];
   if(in_array($ipaddress, $allowed_ip))
   {
      echo 'Tu jau uzsiregistraves';
   }
   else
   {
      echo 'Registracija';

      exit;
   }
   
mysql_close($con);
?>



as pasidariau kad uzsiregistravus zmogaus ip issaugotu mysql lenetei . ir dabar noriu pasidaryt kad 2 kart ant to ip neleistu registruot :D Gal supratot