Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $host = 'localhost';
- $user = 'root';
- $password = '';
- $db_name = 'test';
- $link = mysqli_connect($host, $user, $password, $db_name) or die(mysqli_error($link));
- if (isset($_POST['submit'])) {
- $row = $_POST['rows'];
- $rowar = explode("\n", $row);
- $sql = "REPLACE INTO user (name) VALUES('" . implode("'),('", $rowar) . "')";
- $link->query($sql);
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>test</title>
- </head>
- <body>
- <form action="#" method="post">
- <textarea name="rows" id="rows" cols="30" rows="10"></textarea>
- <input type="submit" name="submit" value="submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement