Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form method="post">
- Nume
- <input type="text" name="user"><br>
- Varsta:
- <input type="text" name="age"><br>
- Parola:
- <input type="password" name="parola"><br>
- Email:
- <input type="text" name="email"><br>
- <input type="submit" name="submit" value="OK">
- </form>
- </body>
- </html>
- <?php
- if(isset($_POST['submit']))
- {
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "site";
- $conn =mysql_connect($servername,$username,$password);
- $db= mysql_select_db($dbname);
- if (mysql_error($conn))
- {
- die("Connection failed: " . $conn->connect_error);
- }
- $user=$_POST['user'];
- $age=$_POST['age'];
- $parola=$_POST['parola'];
- $email=$_POST['email'];
- $sql = "INSERT INTO form (user,age,email) Values('$user','$age','$email')";
- $result = mysql_query($sql);
- echo "Date introduse cu success!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement