User Input In PHP | Sololearn: Learn to code for FREE!

+4

User Input In PHP

How to get user input in PHP is it possible to get user input? If PHP has no user input then how does it process data?

10/6/2017 6:38:52 PM

Aditya

8 Answers

New Answer

+5

all the inputs (data) comes in PHP from html webpages, for input , you need to use form in html document ,And in that form , you need an action and a method. then in PHP you get all the inputs using super variable $_POST OR $_GET and save in normal variable and process it as normal

+4

It Only Displays In the Webpage

+3

I Don't Think So. I Have Just Completed The PHP Course, I Didn't Found it Anywhere 😕😕😕

+3

ok...Andrew I got it

+2

Do you mean forms? Or input like the user click a key on their keyboard? If it is from a form, you can definitely do it in php. Though to do client side interactions you need JavaScript. JavaScript can listen for key presses in the client browser.

+2

I too think the same.....but then how PHP process data if it has no inputs?

+2

I ment user input like from keyboard

+1

why don't work "$line = trim(fgets(STDIN));" in sololearn codes? simply the function tell me $line is empty (null), don't allow write ... but in console it's works! what happen?