Ok...
Many things in your snippet then.
First, when you are using single quotes, PHP variables are not accessible.
You must either use double quotes as delimiter, or get out of the string and back after the variable call.
If you use double quotes, take care of placing arrays or objects between {}
PHP Code:
exec('wget -P '.$_SERVER['DOCUMENT_ROOT'].'/dwn/'.$file.' yada yada yada');
or
PHP Code:
exec("wget -P {$_SERVER['DOCUMENT_ROOT']}/dwn/$file yada yada yada");
Second, separate the option and the parameter
Code:
wget -P/dload $_GET["page"];
will have a syntax error.
Note too that when you use a shell access, PHP will open it in the current directory.
So, specifying "/something" as download directory is assured not to work, except if you have control of the server and made the root level of your tree write enabled for apache.
Much unlikely.
Specify something relative to the current directory, or better, absolute via the $_SERVER['DOCUMENT_ROOT'] variable.
Finally, I don't know if you ever used wget, but it output LOTS of data.
You would better turn them off, by using a -q option
This would make something like:
PHP Code:
exec("wget -q -P {$_SERVER['DOCUMENT_ROOT']}/dwn/ {$_GET["page"]}');
Finally, I'd like to invite you to look at the different shell commands available in PHP, if you haven't already done so.
They behave differently, both in the calling process, in the environment variables available to them (Beware, I looked for days error in my code before understanding that the problem was that HOME=/home/xxx was not present, and called certain programs to fail) and in the way of returning infos.