<? // POŁĄCZENIE Z BAZĄ ?> <meta http-equiv="content-type" content="text/html; charset=windows-1250"> <table align=center width=750 cellspacing=1 bgcolor=silver> <tr> <td colspan=2><center><font style="font-size: 26px">Gra Internetowa</font></center></td> </tr> <tr> <td><center><font style="font-size: 13px">Energia: <br> Pieniądze:</font></center></td> <td><center><font style="font-size: 13px">Anonymus, Witaj w grze</font></center></td> </tr> <tr> <td><center><font style="font-size: 13px"> <a href=index.php>index</a><br> <a href=ind ex.php?frame=register>rejestracja</a> </font></center></td> <td><center><font style="font-size: 13px"> <? // zmienna $go przekazana metoda GET $go = $_GET['frame']; // sprawdzamy czy zmienna $go nie jest pusta // sprawdzamy czy plik o danej nazwie istnieje // jezeli plik nie istnieje wyswietla się komunikat } ?> </font></center></td> </tr> </table>
i plik register.php
<? ?> <font style="font-size: 12px"> <? if( $_POST['log'] == '' || $_POST['pass'] == '' || $_POST['mail'] == '' || $_POST['nazwa'] == '' || $_POST['rasa'] == '') { ?> <form method=post> login<br> <input type=text name=log><br> hasło<br> <input type=password name=pass><br> adres e-mail<br> <input type=text name=mail><br> bohater<br> <input type=text name=nazwa><br> typ<br> <select name=rasa> <option value=chlop>chłop <option value=drwal>drwal </select><br><br> <input type=submit value=register> <input type=reset value=reset> </form> <? } else { $log = $_POST['log']; $has = $_POST['pass']; $mail = $_POST['mail']; $nazwa = $_POST['nazwa']; $rasa = $_POST['rasa']; $zapytanie = "INSERT INTO `users` VALUES(NULL, '$log', '$has', '$mail', '$nazwa', '$rasa', '100', '1000')"; else } ?>
Problem polega na tym ze nie chce mi się dodac rekord do bazy wiecznie wyswietla blad.