/    Sign up×
Community /Pin to ProfileBookmark

Q’s about PHP & CLI

Ok so lately I’ve been creating PHP snippets that run under the command line (servers, clients, all sorts of such stuff). But I have a couple of questions:

1) How can I stop the user from typing things in the terminal while the script is running?

2) Is there any way to prompt for input from the user? (like echo “Please enter your name: ” and then wait for the user to type something and press enter)

EDIT: Of course, I’m doing this under Linux.

Edit again: one other question: Can I delete something I outputted? I tried b but it doesn’t seem to work.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 18.2007 — You might want to look into the [url=http://gtk.php.net/]GTK extension[/url] for creating desktop applications.
Copy linkTweet thisAlerts:
@ZnupiauthorMay 18.2007 — I know about the GTK extension and it does sound very nice. But, I'm a xampp (or lampp) user, and tried installing the GTK extension over that, but couldn't get it to work. I even posted on their forum, but I didn't get any answer ?. Here's the thread: http://www.apachefriends.org/f/viewtopic.php?t=24460
×

Success!

Help @Znupi 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.19,
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,
)...