I believe this will work for you:
index.php
<form id="form" name="form" method="post" action="envia.php">
Links: <label for="nome"></label>
<textarea name="nome" id="nome" cols="20" rows="8"></textarea>
<input type="submit" name="button" id="button" value="Enviar" />
</form>
<?php
include("conexao.php");
$sql = "SELECT seu_campo FROM sua_tabela";
$result = mysqli_query($conn, $sql);
while ($linha = mysqli_fetch_assoc($result)){
echo "<a href=".$linha['nome'].">".$linha['nome']."</a><br>";
}
?>
In index.php
, you enter the values in the textarea and then they are shown as a link just below, after insertion.
envia.php
<?php
include_once("conexao.php");
$nomes = $_POST['nome'];
$separar = explode("\n", $nomes);
foreach($separar as $nome){
$query = "INSERT INTO sua_tabela (seu_campo) VALUES ('".$nome."')";
$resultado = mysqli_query($conn, $query);
}
echo "Seu cadastro foi realizado com sucesso!";
?>
This is where all the magic of separating by breaking line using explode
and then you can insert into the database.
connection.php
<?php
$servidor = "localhost";
$usuario = "root";
$senha = "1234";
$dbname = "teste";
$conn = mysqli_connect($servidor, $usuario, $senha, $dbname);
?>
And this is the connection file I used, just change the value of the variables by your mysql data.
Finally, Replace where it says "your_table" and "your_field" for yours and I believe it will work quietly.