PHP Register didnt working -


hi created php register page site,and page didint work corectly.i dnt have db erorr cant create new user. first time when create new user in db,there new user withuot username , password.

<?php  if(isset($_post['submit'])){ $con = mysql_connect('fdb13.biz.nf','xxx','yyy'); mysql_select_db('1846946_chat',$con);  $uname1= $post['username']; $pword1= $post['password']; $pword2= $post['password2'];  if($pword1 != $pword2){ echo "pasvordi se ne poklapaju!<br>"; } else{ $result = mysql_query("select username korisnici username='$uname1'"); if(mysql_num_rows($result)) echo "username vec postoji,izaberi drgaciji<br>";  else{ mysql_query("insert korisnici (username,password) values ('$uname1','$pword1')"); echo "uspesno si se registroavao.klikni <a href='index.php'>ovde</a> da zapocnes chat!<br>"; } } } ?> <html> <head> </head> <body>  <form name="forma1" method="post" action="register.php"> <table> <tr> <td>unesi username: <input type="text" name="username"></td> </tr> <tr> <td>unesi password: <input type="password" name="password"></td> </tr> <tr> <td>ponovi password: <input type="password" name="password2"></td> </tr> <tr> <td colspan="2"><input type="submit" name="submit" value="registruj"></td> </tr> <tr> <td colspan="2"><a href="index.php" class="button">vrati se na login!</a><br></td> </tr> </table> </form> </body> </html> 


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -