
03-30-2007, 08:53 PM
|
|
|
Join Date: Mar 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by xman_79
Thank you for your useful and explicite answer .
I made a modul in wich a member can add a text.
I want this member to receive a pm in case I erase his text.
I have accomplished a modul but I want to know if the code is correct .
Code:
//The link is : script.php?do=delete&p=$row['text_id']
if(isset($_GET['p']) AND is_numeric($_GET['p']))
{
$me = $db->query_read("SELECT text_title,text_uid,text_user FROM " . TABLE_PREFIX . "table WHERE text_id='{$_GET['p']}'");
$me_s = $db->fetch_array($me);
$txtuid = $me_s['text_uid'];
$username = $me_s['text_user'];
$title = $me_s['text_title'];
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->set('fromuserid', $txtuid);
$pmdm->set('fromusername', $username);
$pmdm->set('title', 'Information');
$pmdm->set('message', "I delete your text : $title .......");
$pmdm->set_recipients($username, $botpermissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->errors;
$pmdm->save();
$db->query_write("DELETE FROM " . TABLE_PREFIX . "table WHERE text_id='{$_GET['p']}'");
define('CP_REDIRECT', "script.php?do=show");
print_stop_message('text_deleted');
exit;
}
Thank you .
|
This looks like a horrible idea, as anyone could just enumerate through the textid's and delete them all.
|