Check to see if post is empty should be how to write

Source: Internet
Author: User
Novice a just self-taught two days in the process card in a lot of places over here is very easy to find all kinds of search to get out of the code is now stuck here for help AH
 
  Print Test
 
  
Show:


Reply to discussion (solution)

I didn't see you have a submit.
You can add Print_r ($_post); See if there's a post

I didn't see you have a submit.
You can add Print_r ($_post); See if there's a post


I have a submit at the back of line 29. Print_r ($_post) to view the empty array

After submission, $_post will not be empty
But $_post[' id ' is used only one and is the last $row [' ID ']
This is obviously wrong.

After submission, $_post will not be empty
But $_post[' id ' is used only one and is the last $row [' ID ']
This is obviously wrong.


Moderator greatly
So what if I'm going to give each line an ID for subsequent positioning and deletion?

If you want to implement a delete through a form submission, you should have a form (form) for each line (TR)



And the forms that surround the outside are not needed
action= " "
is submitted to this page, you can not write

After this commit, $_post[' ID ' is the ID to be deleted

If you want to implement a delete through a form submission, you should have a form (form) for each line (TR)



And the forms that surround the outside are not needed
action= " "
is submitted to this page, you can not write

After this commit, $_post[' ID ' is the ID to be deleted


 
  Print Test
 
  
Show:
ObjName Objinfo
Click here to add information

After I change it, the Echo post is still empty.

Did you click the Delete button?

Pasting HTML from a browser

Print Test
 
  
Show:
ObjName Objinfo
Click here to add Information 1Array ()


Did you click the Delete button?

Pasting HTML from a browser

Did you click the Delete button?

Pasting HTML from a browser


It's hidden's trick.
30 lines of value are wrong.
Thank you so much for your help!

Did you click the Delete button?

Pasting HTML from a browser


It was just one of those mistakes.
My database is written in ObjID $row mention ID's wrong here.
After the change, value gets the value, but why is the post still empty?
Print Test
 
  
Show:
ObjName Objinfo
Click here to add Information 1Array ()

You mean
Click here to add information
1Array
(
)
Is this empty?
There is no value until you submit it (click the Delete button)!


Did you click the Delete button?

Pasting HTML from a browser


It was just one of those mistakes.
My database is written in ObjID $row mention ID's wrong here.
After the change, value gets the value, but why is the post still empty?
Print Test
 
  
Show:
ObjName Objinfo
Click here to add Information 1Array ()


Well 、、、 you still put the form inside.

You mean
Click here to add information
1Array
(
)
Is this empty?
There is no value until you submit it (click the Delete button)!


After you click Delete, you find the post has a value.
Thank you very much!



Did you click the Delete button?

Pasting HTML from a browser


It was just one of those mistakes.
My database is written in ObjID $row mention ID's wrong here.
After the change, value gets the value, but why is the post still empty?
Print Test
 
  
Show:
ObjName Objinfo
Click here to add Information 1Array ()


Well 、、、 you still put the form inside.



Or do you put it in there?




Did you click the Delete button?

Pasting HTML from a browser


It was just one of those mistakes.
My database is written in ObjID $row mention ID's wrong here.
After the change, value gets the value, but why is the post still empty?
Print Test
 
  
Show:
ObjName Objinfo
Click here to add Information 1Array ()


Well 、、、 you still put the form inside.



Or do you put it in there?


So many form look not awkward ...

You can use the check box instead to let the user select the data, the check box name is lst[], all the checkboxes are called this, then the value is $row[id], and then through a button to submit the data to the delete interface, PHP receives LST will be able to get all the selected data

and submit to the current page, the form action can be empty

  • 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.