Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Systems Development (CSC-215)

Similar presentations


Presentation on theme: "Web Systems Development (CSC-215)"— Presentation transcript:

1 Web Systems Development (CSC-215)
Lecture 11: Query Strings Wednesday 14th March 2018

2 Saving State Most of the scripts we have done up to now have had significance for single instances After the scripts are run, removed from web server's memory

3 Saving State Data needs to be saved in between browser request, when, for example, You need to keep track of items in a shopping cart To keep track of a user posting comments in forums Not just logged in users, state for returning users ...

4 Need to preserve state of user interaction

5 Saving State Query strings Cookies HTTP authentication Sessions

6 Query Strings Quick convenient way to pass small amounts of data between browser requests Example: keywords entered in a search function Only use in situations where sending incorrect data won't compromise security

7

8

9 Building Query Strings
A query string is simply a string of characters stored in a URL Manually create a URL containing a query string in PHP script, then include the URL as a link within the displayed page or in an , for example PHP even provides some built - in functions to make the process easier

10

11 Query strings only allow specific characters, so use urlencode() to include exceptions

12

13 Accessing Data

14 Accessing Data

15 example

16

17

18 Pagination Uses query strings to create previous and next page links

19

20

21

22 Lecture content adapted from chapter 13 of Learning PHP, MySQL, JavaScript, CSS & HTML5 & chapter 10 of Beginning PHP 5.3


Download ppt "Web Systems Development (CSC-215)"

Similar presentations


Ads by Google