rejestracja.php
<?php require('connect.php'); { if ($_POST['password']==$_POST['password2']) { if ($ile==0) { $zapytanie="INSERT INTO players (name,password,age) VALUES('$konto','$password','$age')"; } else { } } } else{ ?> <html> <body> <form action="rejestracja.php" method="post"> <strong>Nazwa konta:</strong><input name="konto" type="text" value="" /><br> <strong>Haslo:</strong><input name="password" type="password" value="" /><br> <strong>Powtorz haslo:</strong><input name="password2" type="password" value="" /><br> <strong>Wiek:</strong></strong><input name="age" type="text" value="" /><br> <input type="submit" value="SUBMIT" /> </form> </body> </html> <?php } ?>
connect.php
<? ?>
Kod tabeli 'players'
CREATE TABLE IF NOT EXISTS `players` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) character SET latin1 collate latin1_general_ci NOT NULL, `password` varchar(50) character SET latin1 collate latin1_bin NOT NULL, `adminlevel` int(11) NOT NULL DEFAULT '0', `sex` int(11) NOT NULL DEFAULT '1', `age` int(11) NOT NULL DEFAULT '1', `money` bigint(20) NOT NULL, `bank` int(11) NOT NULL DEFAULT '0', `kills` int(11) NOT NULL, `ck` int(11) NOT NULL DEFAULT '0', `bw` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;