Please help me. I have pasted the code and do not need to download the file now. This post was last edited by abkey1 from 2014-06-0110:a. php & nbsp; includes a check box function & nbsp; display_user_urls ($ url_array) {& nbsp; & nbs. please help me paste the code, you do not need to download the file now.
This post was last edited by abkey1 at 10:13:30 on
A. php contains a check box for deleting selected bookmarks.
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 the delete check box above, you need to click delete bookmarks below
// Only offer the delete option if bookmark table is on this page
Global $ bm_table;
If ($ bm_table = true)
Echo "Delete BM | ";
Else
Echo "Delete BM | ";
?>
The delete function of delete_bms.php is 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 ('ing ing bookmark ');
Check_valid_user ();
If (! Filled_out ($ HTTP_GET_VARS ))
{
Echo 'You have not 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 'Ed Ed '.html specialchars ($ url ).'.
';
Else
Echo 'could not delete '.html specialchars ($ 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. it is normal to connect to the database.
// Delete the bookmark
If (! $ Conn-> query ("delete from bookmark
Where username = '$ user' and bm_url =' $ url '"))
Throw new Exception ('bookmark cocould not be deleted ');