Sending data to the server
From this moment we will begin to interact with data and HTML codes in a broader way. We have just seen how the function print or the command echo are able to write, in the HTML code of a page, some data that was stored in a variable.
Tools to send data: Links and forms
In the previous chapters, we have referred to the basic PHP concept and syntax, and we have applied them in concrete examples.
From this moment we will begin to interact with data and HTML codes in a broader way. We have just seen how the function print or the command echo are able to write, in the HTML code of a page, some data that was stored in a variable.
But the value of that variable was defined by us. What would happen if we let the user of our website enter values for some of our variables?
The answer is that we would start to create dynamic web pages, that is: pages whose content will change (totally, or only partially), depending on the actions the user performs together before asking to be shown one of those pages. In short: interactive pages.
Web browsers, along with the usual order that requests a particular web page, are also capable of sending data to the web server program that is running on the hosting.
This means that they are not just "receivers" of HTML code, which they convert into decorated and visible information on our screen, but that browsers are also "senders" of data sent from our computer to the hosting, and these data are sent in the form of variables, in two ways:
- Through special links
- And using forms
Next, we will analyze both possibilities, since the sending of data from a user's browser to the server, is a fundamentally interactive turn, leaving in the hands of each user the (dynamic) content that will be received by the server.
ChatGPT Free
Ask questions on any topic
CITE ARTICLE
For homework, research, thesis, books, magazines, blogs or academic articles
APA Format Reference:
Delgado, Hugo. (2019).
Sending data to the server.
Retrieved Dec 10, 2024, from
https://disenowebakus.net/en/sending-server-data-php