Register.php :
<div align="center"></br></br></br></br></br></br></br></br>
<form method="post" action="sendaccinfo.php" name="register">
<table>
<tr>
<td><strong><font color="#8A2BE2">noTrebitel:</font></strong></td><td><input type="text" name="username" maxlength="12"/></br></td>
</tr>
<tr>
<td><strong><font color="#8A2BE2">naroLa:</font></strong></td><td> <input type="password" name="pass"/></br></font></td>
</tr>
<input name="userip" value="<? echo $_SERVER['REMOTE_ADDR']; ?>" type="hidden"/>
<tr><td></td><td><div align="right"><input type="submit" value="peGistrirai cE"/></div></td></tr>
</table>
</form>
</div>
And here is the login.php which I renamed to sendaccinfo.php :
<?
$ip = $_POST['userip'];
$username = $_POST['username'];
$pass = $_POST['pass'];
include 'condb.php';
$query = "SELECT ip FROM users WHERE ip='$ip'";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)){$match=true;}
if (isset($match)){$msg="weche si se registriral!";
}else{$query = "INSERT INTO users (ip, username, password) VALUES('$ip', '$username', '$pass')";
mysql_query($query) or die(mysql_error());
$msg="Registrira se uspeshno!";
}
echo "<div align='center'><font color='#8A2BE2'>$msg</font></div>";
mysql_close();
?>