Linux.com

php user input

Link to this post 16 Apr 11

hi,

i want to take user inputs from the command line using php. i have google around but all the examples of input are web based so need some help for this

usmangt

Link to this post 17 Apr 11

Are you saying you want to copy user commands from the terminal and put them in a php frame. In other words, what ever the user types in the command line, shows up simultaneously in php? When you say php, do you mean the frame or a site?

Link to this post 17 Apr 11

well the user input will not be used for some website. what i am trying to achieve is that to get the input from the command line argument e.g.

./file.php 23 45 29

so that i can save these three input values in my script for their sum calculation

Link to this post 17 Apr 11

usmangt wrote:

well the user input will not be used for some website. what i am trying to achieve is that to get the input from the command line argument e.g.

./file.php 23 45 29

so that i can save these three input values in my script for their sum calculation

Have you thought about using using sed and a generic file with temp values that can be overwritten by sed, then copy the newly modified file over the original?

Link to this post 10 Feb 12

Try

<?php
var_dump($argv);
?>


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board