Well, Bill, let’s see, first I will assume your row of data is inside a table? And, you have added a button to that
row that calls a PHP script and deletes data from where ever you get the table created from. Then, you re-do
the table and that row is gone. Is that what you mean?
Normally, how I handle that is using a button that formatted a bit like this…
name="del_row">Delete this row |
It is actually really a submit button. The ID that is in the value of the button is unique to the row. The name
of the button is the same as every other row’s name. When the user presses any row’s button, it call my
PHP code which deletes that row from the database using the ID in the value of the posted row. Since the
user can only press one button at a time, it has only one ID to delete. Then, it just continues reloading the
table and the page. This has worked very well for me for many years… Also, I use CSS to make the button
look really nice! (Lots of websites that make fancy buttons online for you…)
Now that I have explained how delete buttons are used in general, curl is not really used for this. Curl is
more for website access and posting to sites. Perhaps I do not understand what you are deleting. Is it
data in a database? Are you loading a table with books and then wanting to delete one from a list or from
a table? Or do you want to delete a file in that URL? The curl code you show is set to delete a URL. If that
is what you want to do, first you need to make sure that URL exists. Also, I do feel that you still need to
make sure that the URL in the CURL routine is formatted correctly. That was the DIE() function I showed
you. I bet when you try that, that you will find it has an extra space in the URL or a slash missing.
One last note is that the folder you are deleting a file from must have the correct permissions set on it to
allow CURL to delete files from it.
Not sure if any of this helps…