I have a list of user for a site, mainly using a unique ID for each members.
I need to have a button after each name to delete or modify but i can’t find how to do it properly, here’s the code !
$result = mysql_query("SELECT * FROM users ORDER BY ID_Usager");
while($row = mysql_fetch_array($result))
{
echo "<form method='post'>";
echo "<tr>";
echo "<td>" . $row['Pseudo'] . "</td>";
echo "<td>" . $tempID . "</td>";
echo "<td>" . $row['Email'] . "</td>";
echo "<td>" . $row['Status'] . "<input type='submit' name='delete[" . $tempID . "]' value='Delete'> <input type='submit' name='modify[" . $tempID . "]' value='Modify'> </td>";
echo "</tr>";
echo "</form>";
}
(I have skipped some table code..)
So this show as :
Vincent 25625 [DELETE] [MODIFY]
So what I was think, when i click submit, it reload the page, i look if the Post Delete[] is empty, or modify is empty, …
if(!empty($_POST['delete']))
{
$test[] = $_GET['delete[]']; ---- LINE 163 ERROR...
//Delete from blablabla userID = $test;
}
else
{
... check for modify then blablabla.
}
But its not working, i get an error.
Notice: Undefined index: delete[] in C:\wamp\www\VMAD\admin_usagers.php on line 163
The
[]is the problem. It should be