Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

A little help for a script

Discussion in 'Programming' started by OldDarkstarAccount, Jun 12, 2008.

  1. OldDarkstarAccount

    OldDarkstarAccount Senior Member Webmaster

    bash -> php

    In a bash script the information in taken after the following model

    read INFO
    echo $INFO

    How to I do this in a php script ? ( taking the info of the client ? ).
  2. Dimitar Christoff

    Dimitar Christoff Member Webmaster

    do you mean for a PHP script as a shell script to take a variable from console in an interactive way? if so, i don't know - ask on #php on efnet but you can access script shell arguments ($argv) - more help here http://www.phphacks.com/content/view/32/33/
    otherwise, if you are talking about the browser and a form submission, PHP can access 2 collections of data:
    $_GET and $_POST

    say, they submit a form with a field name=foo value=bar to foo.php, it will translate to:
    foo.php?foo=bar and be available via $_GET['foo'] with the value of 'bar'.

    similarly it can be with method=post and go to $_POST['foo'].
    Last edited by a moderator: Aug 8, 2008

Featured Resources (View All)

Share This Page