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

nezinu, es neesmu gudrs. :D

 

var mēģināt izdomāt kkā, ka viss ir uz formas - vārds, utt, un hidden field - "ievāc" IP, tad POST un uala! viss "ieseivojas" count.inc, vai kaa savaadaak nosauc, jo tas vairs nebuus tik "kaunteris" :DD

Link to comment
Share on other sites

$_POST['username'] nozīmē, ka php fails apstrādās formu, kurai action norāda uz šo skriptu, method="POST" un formā ir ievadāms lauks <input type="text" name="username" />

Tāpēc jau arī nekas nerakstās, ka tev nav nekādas formas.

Link to comment
Share on other sites

aa, tad moška šitā derēs?

<?php
    $f = fopen('ip_adreses.txt', 'a');
fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n");
fclose($f)
    ?>
<html>
<form action="ip_adreses.txt" method="post">
<h1>Tavs vārds</h1>
<table>
<tr><td>Vārds:</td><td><input type="text" name="username"></td></tr>
</html>

Link to comment
Share on other sites

aa, tad moška šitā derēs?

<?php
    $f = fopen('ip_adreses.txt', 'a');
fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n");
fclose($f)
    ?>
<html>
<form action="ip_adreses.txt" method="post">
<h1>Tavs vārds</h1>
<table>
<tr><td>Vārds:</td><td><input type="text" name="username"></td></tr>
</html>

20739[/snapback]

 

hmm - jābūt tā!!! -

ps: filename sauc citaadaak... kautvai tests.php, vai tests.htm :D

<html>
<head>


</head>

<body>
<form name="form1" method="post" action="ip_adreses.php">
 <input type="text" name="username">
</form>
</body>
</html>

un wnk izmaini "ip_adreses.php" pret to news.php... un pogu neliku - netiik - wnk piespied enter :P

Edited by SkaKri
Link to comment
Share on other sites

dutchy??? TU TIKKO VISU SAJAUCI!

 

ok - saakam no saakuma.

uztaisi

==================test.php==============================

 

<form action="test_ok.php" method="post">

<h1>Tavs vārds</h1>

<table>

<tr><td>Vārds:</td><td><input type="text" name="username"></td></tr>

</form>

SPIED ENTER!

=====================================================

uztaisi txt failu: ip_log.txt

=====================================================

un tagad:

=================test_ok.php============================

<?php

$f = fopen('ip_log.txt', 'a');

fwrite($f, $_POST['username'] . '=' . $_SERVER['REMOTE_ADDR'] . "\n");

fclose($f)

?>

<b>paldies - jūsu dati saglabāti arhivācijā. :P</b>

=====================================================

 

 

 

UN viss... kas tur tik grūts. pat es sapratu . haha. :DD

Edited by SkaKri
Link to comment
Share on other sites


×
×
  • Create New...