11 line Php+js to correct the wrong

Source: Internet
Author: User




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


Reply to discussion (solution)

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

AMP does not know what to mean, but like the first floor said after the removal, still can not achieve

To see you like this you think of me before refueling
I suggest you install a Firefox firebug JS error to see.

First make sure the page jumps to the delete1.php page?

And what do you mean by "impossible"?

According to the 3 floor, I put the script part in the, the page now jumps to delete1.php, but the delete1.php page does not receive the ID

$array [' id '] have a value? Output a bit:

AMP does not know what to mean, but like the first floor said after the removal, still can not achieve



AMP is the escape of this symbol &

Location can only jump cannot pass value
With action

Location can only jump cannot pass value
With action


Function del () {
if (!confirm ("Are you sure you want to delete these records?") ")){
Return
}
Document.action = "delete1.php?lmbs= & id= ";
} is that so?
However, click Delete. The dialog box pops up, and after you press OK, nothing happens.

$array [' id '] have a value? Output a bit:


I've worked with $select=mysql_query before ("SELECT * from Tb_content", $conn);
$array =mysql_fetch_array ($selects);
Just added an echo output, each post has an ID display.

What reaction does not mean that the post has not been deleted, should not go to delete1.php

What reaction does not mean that the post has not been deleted, should not go to delete1.php


You print_r in the delete1.php ($_get);
Let's see what we got.

Print_r Result: Failed Array ([LMBS] + theme management [id] = =)


Found the value of Lmbs passed, id not

I went to test the microbes first. Our elective exams, really thank you guys, I'll come back in the evening to study

Then check the page "source code" in document.location = "delete1.php?lmbs= &id= "; the corresponding part is something.

Then check the page "source code" in document.location = "delete1.php?lmbs= &id= "; the corresponding part is something.


I have an if ($_get[' id ') in delete1.php
The result of the display is that no ID is get to the

I went to test the microbes first. Our elective exams, really thank you guys, I'll come back in the evening to study



"Microbes" .... Good Cow ~ ~ can make a few pet?

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 "," merge, as a string return//document.location = "delete1.php?lmbs=
 
   &id=" +ID;  }






Alert (' delete1.php?lmbs= &id= ; ');
Look right.

JS in the value can only be obtained by JS, you should be the code through the ID to delete a record, you can use jquery to write!









Note Import Jquery.js

There are some problems with the above!









As long as your $array[' ID ' has a value, you should be able to get the

[quote= references 14 floor evan2916 's reply:]

I went to test the microbes first. Our elective exams, really thank you guys, I'll come back in the evening to study



"Microbes" .... Good Cow ~ ~ can make a few pet?
Haha, it should have been with us for a long time, and a considerable amount.
  • 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.