Page 1 of 1

Trouble outputting delete function in table

Posted: Tue Jun 17, 2008 6:53 am
by mrgooding
Hi All

I'm having trouble putting a Delete Button into a table, to allow a given row to be deleted:

Echo"<td><a href=' . $_SERVER['PHP_SELF'] . '?deletecontact=' . $cid . '>' . 'Delete </a></td>";

is the code i'm using, but this causes an error - It worked ok before I put it into a table cell, but then previously it had some " marks within the code, which i've now had to remove because of using the echo function.

Any pointers as to why this won't work would be greatly appreciated (i'd rather know the reason why this doesn't work than just have someone solve it for me).

Re: Trouble outputting delete function in table

Posted: Tue Jun 17, 2008 7:03 am
by WebbieDave
You're not closing and reopening your quotes correctly.

Here's how I'd write it:

Code: Select all

echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?deletecontact=' . $cid . '">Delete</a></td>';

Re: Trouble outputting delete function in table

Posted: Tue Jun 17, 2008 7:21 am
by mrgooding
Thanks, WebbieDave - that works now :)