课程: PHP with MySQL Essential Training: 1 The Basics

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Use URL parameters

Use URL parameters

- [Instructor] In this movie, we'll learn how to send a value from one page to the next by using URL parameters. This can also be referred to as query parameters. The URL parameters are the part of the URL which comes after the question mark. The format is always name of the parameter, then an equal sign, and then the value of the parameter. So here we have page=2. URL parameters generally modify the behavior of the code used for the response. So in this example, the same PHP code would be run but its behavior would probably be modified so that returned a second page of results. You can send more than one URL parameter by using an ampersand in between them. Here I have category equals seven and page equals three. If you surf around on sites like Google and Amazon, you'll see many examples of URL parameters being used. URL parameters are useful because they allow us to pass data from one page to another via links. When a new page request is received, PHP is automatically going to take…

内容