V
V
Vlad Zaitsev2013-02-04 00:30:28
PHP
Vlad Zaitsev, 2013-02-04 00:30:28

Handling get or post parameters in PHP

In php I am zero. There is a page with buttons that link to the same page by passing 2 get parameters.
How to execute the function (exec(whattotam)) depending on these parameters in PHP?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zapimir, 2013-02-04
@vvzvlad

if(isset($_GET['param1']) && $_GET['param1'] == 'value1'){
    exec(...);
}

From the post, similarly only the $_POST array

V
Vlad Zaitsev, 2013-02-04
@vvzvlad

It turned out a little easier.
$channel=($_GET['channel']);
$command="-".($_GET['command'])."_ch";
$level=($_GET['level']);
exec("noolite -api $command $channel $level");
Actually, I was missing the construction ($_GET['channel']).

T
TyzhSysAdmin, 2013-02-04
@POS_troi

Incoming data would be good to check

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question