Please help, little brother I posted the code, now do not download the file to see

Source: Internet
Author: User
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 ');
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.