How to implement a delete Button in PHP?

Neil

New member
I have been searching since yesterday, I'm trying to implement a delete button in PHP, I find out that I need to use a command which calls hidden, so I have implemented a page where people can send information that is charged in an automatic table that can create enough rows and columns according to its needs.
So, I find out how to implement it, the problem is that I have no idea how the hidden code works and how I can make a code to identify each line of my table to delete exactly what the delete button requires for.

that's what I need:

<html>
<body>
<p> Tabela </p>
<?php
echo "<table border='2'>";
echo "<tr>";
$arquivo=fopen("tabela.txt","r");
While (!feof($arquivo)) {
echo "<tr>";
for ( $x=0; $x<=2; $x++ ) {
echo "<th>";
echo fgets($arquivo). "</th>";
}
if($x=2) {
echo "<th>";
echo '<form name="input" action="delete.php" method="post">';
echo '<input type="submit" value="Deletar">';
echo '</form>';
echo "</th>";
echo '</tr>';
}
}
fclose($arquivo);
?>
</body>
</html>


So, that's my code...
I just don't know exactly how to implement the hidden code in my code, to make it identify each row that my code keep creating according to the information that the usuary is sending...
It's a dynamic table...

I'm thankful for your help.
Sincerelly, Neil Endrigo Cardoso de Miranda.
 
Back
Top