Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <pre>
- <form>
- login: <input type='text' name='login'>
- haslo: <input type='password' name='haslo'>
- imie: <input type='text' name='imie'>
- nazwisko: <input type='text' name='nazwisko'>
- telefon: <input type='number' name='telefon'>
- <input type='submit' name='slij'>
- </form>
- </pre>
- <?php
- if(isset($_GET['slij']))
- {
- $login=$_GET['login'];
- $haslo=$_GET['haslo'];
- $imie=$_GET['imie'];
- $nazwisko=$_GET['nazwisko'];
- $telefon=$_GET['telefon'];
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname='waluk';
- $conn = new mysqli($servername, $username, $password);
- if ($conn->connect_error) {
- die("niedziala " . $conn->connect_error);
- }
- else
- {
- $conn = new mysqli($servername, $username, $password, $dbname);
- $sql='INSERT INTO osoba (id, login, haslo,imie,nazwisko,telefon)
- VALUES ('','.$login.', '.$haslo.','.$imie.','.$nazwisko.','.$telefon.')';
- //$sql='INSERT INTO osoba (login)
- //VALUEs ('."asddsa".')';
- if ($conn->query($sql) === TRUE) {
- echo "dodano";
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement