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


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


8 Answers

New Answer


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


It Only Displays In the Webpage


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


ok...Andrew I got it


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.


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


I ment user input like from keyboard


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?