Please help, I posted the code, now do not download the file to see.
This post was last edited by Abkey1 on 2014-06-01 10:13:30
A.php contains a check box to delete a selected bookmark
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;
?>
}
After clicking on the checkbox above, you need to click Delete bookmark below.
Only offer the delete option if bookmark table was on this page
Global $BM _table;
if ($BM _table==true)
Else
?>
delete_bms.php Delete function as follows
Require_once (' bookmark_fns.php ');
Session_Start ();
Create short variable names
$del _me = $HTTP _get_vars[' Del_me ');
$valid _user = $HTTP _get_vars[' Valid_user ');
Do_html_header (' Deleting bookmarks ');
Check_valid_user ();
if (!filled_out ($HTTP _get_vars))
{
Echo ' Chosen any bookmarks to delete.
Please try again. ';
Display_user_menu ();
Do_html_footer ();
Exit
}
Else
{
if (count ($del _me) >0)
{
foreach ($del _me as $url)
{
if (DELETE_BM ($valid _user, $url))
Echo ' Deleted '. Htmlspecialchars ($url).
';
Else
Echo ' Could not delete '. Htmlspecialchars ($url).
';
}
}
Else
Echo ' No bookmarks selected for deletion ';
}
Get the bookmarks this user has saved
if ($url _array = Get_user_urls ($valid _user))
Display_user_urls ($url _array);
Display_user_menu ();
Do_html_footer ();
?>
The code for the DELETE_BM function is as follows
function DELETE_BM ($user, $url)
{
Delete one URL from the database
$conn = Db_connect (); This is already included in another PHP file, and connecting to the database is normal.
Delete the bookmark
where Username= ' $user ' and bm_url= ' $url '))
throw new Exception (' Bookmark could not be deleted ');