Here is my code;
This part is to delete a link in the db, but you need to know the name of it (It would be better if you could choose from a list that is in the db);
Code: Select all
<?
include "inc/loader.php";
?>
<HTML>
<BODY>
<form method="post" action="dellink.php" name="editor">
<div align="center"><center><table width="600" border="0" cellspacing="0" cellpadding="1"
bgcolor="#000000" align="center">
<tr>
<font size="2" face="Verdana" color="#ff0000" , Arial, Helvetica, sans-serif"><b>Delete External Link</b></font><td><div
align="center"><center><table width="598" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><b>Button Name</b>: <b>
<input type="text" name="linkbutton" size="50">
</b></font></td>
</tr>
</table>
</td>
</tr>
</table>
</center></div>
<br>
<div align="center"><center><table width="600" border="0" cellspacing="0"
cellpadding="1" bgcolor="#000000" align="center">
<tr>
<td><table width="598" border="0" cellspacing="0" cellpadding="1">
<tr>
<td bgcolor="#CCCCCC"><div align="center"><p><input TYPE="SUBMIT" NAME="submit"
VALUE="Delete External Link"></td>
</tr>
</table>
</td>
</tr>
</table>
</center></div>
</form>
</body>
this is the file the form above POST to, to delete the record;
Code: Select all
<?
include "inc/loader.php";
$query = "DELETE FROM ".DB_PREFIX."_link WHERE link_button = '$linkbutton' ";
mysql_query($query);
echo mysql_error($connexion);
$body=stripslashes($body);
$title=stripslashes($title);
header("Location: editor.php");
?>
[quote]
Regards,
NPereira[/quote]