Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use GET and POST of PHP

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to use GET and POST of PHP". In daily operation, I believe many people have doubts about how to use GET and POST of PHP. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to use GET and POST of PHP". Next, please follow the editor to study!

1. Login page (GET)

1. Modify the action property to ".. / php/dl.php": submit the form content to this page for execution.

2. Modify the method attribute to "get": the submission method is GET.

Please enter your user name and password for login: password:

Run result: whatever the user name is submitted here, the following parameters will be accepted by dl.php.

3. Write dl.php

/ / specify the encoding method

Run result: whatever the user name is submitted here, the following parameters will be accepted by dl.php.

4. Only registered users can log in, so add a judgment about the database later.

First determine whether it is a form submission, and then determine whether the user name and password are empty and correct

The parameters submitted by http://192.168.1.129/php/dl.php?user=aiyou&pass=bucuo&submit= login are all in URL, which is not safe.

Registration page (POST)

1. Modify the action property to ".. / php/zc.php": submit the form content to this page for execution.

2. Modify the method attribute to "post": the submission method is POST.

User name: password: confirmation password: sex: love between men and women: singing, dancing, watching movie avatar upload: personality signature:

Run result: whatever the user name is submitted here, the following parameters will be accepted by zc.php.

3. Write zc.php

It only determines whether the user name, password and confirmation password are filled in, and does not involve the database.

At this point, the study on "how to use GET and POST of PHP" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report