Use $_POST to get input values on the same page

前端 未结 1 504
孤街浪徒
孤街浪徒 2020-12-10 08:46

Sorry if this is a rather basic question.

I have a page with an HTML form. The code looks like this:

1条回答
  •  粉色の甜心
    2020-12-10 08:59

    Put this on a php file:

    
    
      Example value: 
      Example value 2: 
      
    
    

    It will execute the whole file as PHP. The first time you open it, $_POST['submit'] won't be set because the form has not been sent. Once you click on the submit button, it will print the information.

    0 讨论(0)
提交回复
热议问题