You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
If I pass an arg to a PHP prog, how do I read it? Like site.com/prog.php?arg=cool - how do I read arg and get the word "cool" in my program?
And - if an arg is not there, like, say above, the argument "arg2" is not there, only "arg" - whatever method is used for reading args (eg. $_REQUEST something or whatever), that will be blank for arg2, right? (eg. $_REQUEST["arg2"] etc.)
J.O. Aho
unread,
Jun 2, 2017, 4:45:44 PM6/2/17
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On 06/02/17 21:58, bit-n...@hotmail.com wrote:
> If I pass an arg to a PHP prog, how do I read it? Like site.com/prog.php?arg=cool - how do I read arg and get the word "cool" in my program?
$_GET[] if you just expect requests which has the value in the URL as in
your example.
$_REQUEST[] if you expect both POST (<form><input type='text'...><input
type='submit'...></form>) and GET (as in your example).
> And - if an arg is not there, like, say above, the argument "arg2" is not there, only "arg" - whatever method is used for reading args (eg. $_REQUEST something or whatever), that will be blank for arg2, right? (eg. $_REQUEST["arg2"] etc.)
If arg2 is sent but with an empty value, then the $_GET['arg2'] will be
empty, if arg2 is completely missing from the request, then there ain't
a $_GET['arg2']