本帖最后由 abkey1 于 2014-06-01 10:13:30 编辑 a.php 包含一个删除选中书签的复选框
function display_user_urls($url_array)
{
// display the table of urls
// set global variable, so we can test later if this is on the page
global $bm_table;
$bm_table = true;
?>
0)
{
foreach ($url_array as $url)
{
if ($color == #cccccc)
$color = #ffffff;
else
$color = #cccccc;
// remember to call htmlspecialchars() when we are displaying user data
echo .htmlspecialchars($url). ;
echo ;
echo
;
}
}
else
echo no bookmarks on record
;
?>
delete_bm函数的代码如下
function delete_bm($user, $url)
{
// delete one url from the database
$conn = db_connect(); //此处已经包含在另一个php文件中,连接数据库是正常的
// delete the bookmark
if (!$conn->query( delete from bookmark
where username='$user' and bm_url='$url'))
throw new exception('bookmark could not be deleted');