Jump to content
php.lv forumi

Ar I.P. atcerās vārdu


dutchy

Recommended Posts

  • Replies 47
  • Created
  • Last Reply

Top Posters In This Topic

bļā (atvainojos), apnicis... kur tik neapķērīgi...

pat man pieleca... waaau..

 

<?php
$ip_adreses = file("ip_log.txt");
for($i=0;$i<count($ip_adreses);$i++)
{

  	 $exp = explode("=", $ip_adreses[$i]);
  	 if ($_SERVER['REMOTE_ADDR'] == trim($exp[1]))
 
 //
          $jau_regots = true;
          $dati = array($exp[0],$exp[1]);
  	 }


if ($jau_regots == true){
 echo 'Sveiks '.$dati[0];
} else {

echo '<form action="test_.php" method="post">'; //maini pret savas formas adresi
echo '<h1>Tavs vārds</h1>';
echo '<table>';
echo '<tr><td>Vārds:</td><td><input type="text" name="username"></td></tr>';
echo '</form>';



}
?>

//test_.php <-remove shito
<?php
$f = fopen('ip_log.txt', 'a');
fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n");
fclose($f)
?>

 

derēs? ;)

Edited by SkaKri
Link to comment
Share on other sites


×
×
  • Create New...