POST and GET problems

Source: Internet
Author: User
POST and GET problems
 

This is the code. $ id cannot be output in the next two if statements. what is the problem and how to solve it.


Reply to discussion (solution)

If (isset ($ _ POST ['submit ']) are you using GET or POST?

Get used in the previous link, and fill in the post value in the database

If the id is passed only in the link, will there be no id in the post form?

If the id is passed only in the link, will there be no id in the post form?



Yes, no id is required for post, and no id is required for the form.
This is a webpage for modifying news.

This is the previous page. click modify to upload an id.

Go to the second page and read the content by passing the id to display it for easy re-editing.

Then this commit uses POST and attaches all the source code.
 
 

No id is passed in the form? So how do you know who has been modified?

No id is passed in the form? So how do you know who has been modified?



26 rows, id is queried in the database in the form of a variable

What's wrong with you?
You have test code on your own. why is the id value not printed when the form is submitted?

What's wrong with you?
You have test code on your own. why is the id value not printed when the form is submitted?

What's wrong with you?
You have test code on your own. why is the id value not printed when the form is submitted?


I mean The tag does not have the function of writing IDs to the database. the IDs are obtained from the previous page through get and saved in $ id.
12 lines can be echo,
After you click submit, the output in lines 16 and 25 is empty.

On the modify and edit page, place the value of the get id in a hidden form and submit it together. Do not use global;

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.