11 Line Php+js Solution

Source: Internet
Author: User
11 line Php+js to correct the wrong




If after document.location add Baidu website, can function normally.
Maybe JS in the PHP set what is wrong?
------Solution--------------------

Function del () {
if (!confirm ("Are you sure you want to delete these records?") Submitted records will not be deleted! ")) {
Return
}
document.location = "delete1.php?lmbs= &id= ";
}



Logic problem, your document.location finally get the ID in the string without any value ....

PHP is the server side, JS is the client, your id= Obviously there is no value. The ID here can only be obtained by JS.



Function del ()
{
if (!confirm ("Are you sure you want to delete these records?") Submitted records will not be deleted! ")) {
Return
}
Else
{

Here write the code with JS to get the selected ID, and then use "," merged, as a string to return
//


document.location = "delete1.php?lmbs= &id=" +ID;

}

}







------Solution--------------------
There are some problems with the above!









As long as your $array[' ID ' has a value, you should be able to get the
  • 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.