Sunday, October 5, 2014

2.2 $_GET

The Code (Controller.php)


- This is the code inside our controller.php.     As you notice, we used the $_GET variable to catch the data of the form having GET method. This is basically the whole logic of this tutorial.  Then we echo or print out the retrieved data in order for us to see it in the browser.





The Output


- Ok this is the output of our form, please note that "hac101" & "pass123" value is what we type in the text input and "Add" value is the default value we given in the submit button.



The URL Encoding


- Now lets focus on how the $_GET variable works or probably how it encodes the data in the url. As pretty much obvious as per the illustration, it printed out all the reference name as well as their value and stated with "?" symbol and combined with "&" symbol



The Conclusion

- When using the $_GET variable, all the reference data stay permanently in the url. Even though, the user refresh the browser the data remains in tact as long as the page dosent change.




2 comments:

Note: Only a member of this blog may post a comment.