+45

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

Sukki😘

32 Answers

New Answer

+3

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

+41

Djerry Altimo PHP not in java

+41

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

+41

Alabo Gift thanks for the information.

+40

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

+40

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

+39

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

+39

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

+39

Sandeep Kumar Saw I will try. Thank you

+38

Prashanth Kumar from client /customer/ user input .

+38

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

+35

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

+13

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

+8

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

+8

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

+8

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

+8

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

+7

ooo.. i tbought u were talking bout cli 😅

+6

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

+4

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 ); ?>