Jump to content

Input/output in PHP?


eduard

Recommended Posts

Input is typically data received from an HTML form via GET or POST. But I think I would also consider file data or database records input as well. Variables are just a means of referencing data, be it input or output.Output is typically done with echo or print, yes. Specifically, output is usually an HTML document, but could also be database records or files.

Link to comment
Share on other sites

To clarify. Any text in a PHP document that is not within <?php ?> tags will be output. (PHP can be structured so that this is not always the case, but you really have to know what you're doing.) This is in addition to echo and print statements within PHP tags.

Link to comment
Share on other sites

To clarify. Any text in a PHP document that is not within <?php ?> tags will be output. (PHP can be structured so that this is not always the case, but you really have to know what you're doing.) This is in addition to echo and print statements within PHP tags.
Does this mean that anything in the <?php ?> tags is input?
Link to comment
Share on other sites

Input is typically data received from an HTML form via GET or POST. But I think I would also consider file data or database records input as well. Variables are just a means of referencing data, be it input or output.Output is typically done with echo or print, yes. Specifically, output is usually an HTML document, but could also be database records or files.
Thanks!
Link to comment
Share on other sites

Does this mean that anything in the <?php ?> tags is input?
No. Shadow's answer that you quoted in Post #5 pretty much covers the idea (add $_COOKIE, $_SESSION, $_FILES, and $_SERVER to the list.) Input is only available in the PHP tags, but that doesn't mean anything in the tags is input. Input is not something you write into your code. It is something external that your code has to receive.
Link to comment
Share on other sites

No. Shadow's answer that you quoted in Post #5 pretty much covers the idea (add $_COOKIE, $_SESSION, $_FILES, and $_SERVER to the list.) Input is only available in the PHP tags, but that doesn't mean anything in the tags is input. Input is not something you write into your code. It is something external that your code has to receive.
So, input is rational and the computer language it isn´t?
Link to comment
Share on other sites

Input and output are very abstract terms...Input - anything that something receives.Output - anything that something gives (often based on the supplied input).Anything between "<?php" and "?>" is input to the PHP interpreter from you - the developer.Anything in $_POST, $_GET, $_COOKIE is input to your PHP code from the user's (HTTP) request.Anything not between "<?php" and "?>" is part of the ouput from the PHP interpreter.

Link to comment
Share on other sites

Input and output are very abstract terms...Input - anything that something receives.Output - anything that something gives (often based on the supplied input).Anything between "<?php" and "?>" is input to the PHP interpreter from you - the developer.Anything in $_POST, $_GET, $_COOKIE is input to your PHP code from the user's (HTTP) request.Anything not between "<?php" and "?>" is part of the ouput from the PHP interpreter.
Thanks!(I wished I had had you as my teacher!)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...