Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $link = mysql_connect ("ip","user","pass") or die ("DB server je nedostupny!");
- mysql_query("SET NAMES utf-8");
- $db = mysql_select_db("pw2", $link) or die ("Tabulka neexistuje!");
- ?>
- <html>
- <head><title>PW2 - Registrace</title></head>
- <body>
- <form action='./registrace.php' method='post' enctype='text/form-data'>
- <?php
- if (!empty($_POST['username']))
- {
- $user = $_POST["username"];
- $pass = $_POST["sha_pash_hash"];
- mysql_query("insert into user(username, password) values ('".$_POST["username"]."','".sha1(strtoupper($user).':'.strtoupper($pass))."')");
- $vypis_id = mysql_query("select id, username from user where username = '".$_POST["username"]."'");
- while($row=mysql_fetch_array($vypis_id)) {
- echo ("ID Vaseho uctu je <b>".$row["id"]."</b> a username je <b> ".$row["username"]."</b><br>");
- }
- echo '<a href="index_reg.php">Klikni pro navrat</a>';
- }
- ?>
- <fieldset>
- <table>
- <tr>
- <td>Nazev Uctu</td><td><input type='text' name='username' /></td>
- </tr>
- <tr>
- <td>Heslo</td><td><input type='password' name='sha_pash_hash' /></td>
- </tr>
- <tr>
- <td colspan='2'><input type='submit' name='submit' value='odeslat' /></td>
- </tr>
- </table>
- </fieldset>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement