/    Sign up×
Community /Pin to ProfileBookmark

User input from keyboard.

Can some one please help me with php user input?

From basic you would do something like this:

morekey:a$ = inkey$:if len(a$ < 1 then goto morekey

This way, it waits for any key to be pressed then contines on.

How can I do this in php for example I am trying to do something like:

for ($i=1; $i<=100 $i++) {
print “$worker[$i]<br>”;
morekey:a$ = inkey$:if len(a$ < 1 then goto morekey
if a$ = “1” then do one thing.
if a$ = “2” then do something else etc.
}

I know that line above won’t work in php as it is basic, but how do I do the same thing in php. I also understand the $ signs must be on the left, but as I said the sample is using basic. Actually Q basic 4.5.

I want the system to stop and wait for any key to be touched.

Thanks

Thanks

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@bokehJul 23.2005 — The only way to get individual keystrokes to be sent to the server (and receive info back) is the XMLHttpRequest object. This means javascript must be enabled. Everything else would require the page to be reloaded.
×

Success!

Help @tommytx spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...