How to read the values from on-screen keyboard/keyboard in PHP.

As PHP is a server scripting language. Shall we read values or not..? Give me a best example if possible. I observed one program reading values in stack manner.

5/14/2019 1:48:15 PM


32 Answers

New Answer


Create a html form in the php file and by the help of isset method and $_POST get the input


Djerry Altimo PHP not in java


Prashanth Kumar without files concept. Am thinking to pass arguments in an Array.


Alabo Gift thanks for the information.


Sonic I don't know much about it but it may stands for standard input file stream. Used for giving input to files.


Sandeep Kumar Saw don't bother I will try my self first.


Alabo Gift how shall I pass the arguments via keyboard. php


Sandeep Kumar Saw Thanks for the information. My self I searched it in Google too but no response. 😊


Sandeep Kumar Saw I will try. Thank you


Prashanth Kumar from client /customer/ user input .


Sandeep Kumar Saw yes but I will not satisfy until coding on this topic. Thankyou 😊.


Sandeep Kumar Saw shall we create a text box in this app.


$file=fopen('php://stdin','r'); $cont=fread($file); echo $cont;


I think the onscreen keyboard gives u the same input as the normal keyboard so you read it same way either through an input tag, text area or any other content editable field


Php is a server side language, basically the input comes from the browser end , so you use HTML forms to collect input from users and send them to the server for processing using either the get or post methods


What exactly is the php://stdin file stream? Is it a local terminal standard input on the server?


Sukki😘 what do u want actually 😅😅 input from cli or html form 😶


ooo.. i tbought u were talking bout cli 😅


Public void main {String[] args[] };


It is possible to read the stdin by creating a file handle to php://stdin and then read from it with fgets() for a line for example (or, fgetc() for a single character): <?php $f = fopen( 'php://stdin', 'r' ); while( $line = fgets( $f ) ) { echo $line; } fclose( $f ); ?>