Run configuration, script parameters

Tell me, please, how to set parameters.
I want to set $_GET['key']='zz' (or ?key=zz)
This forum posting page still bugged, so read from bottom to top.

Comment actions Permalink

When using Php Script configuration, parameters are accessed like from the command line, via $argv, see
If you want to test parameters passed via $_GET, you need to run your script on server (using PHP Web Application Run/Debug configuration where you can specify URL to open with parameters).

Comment actions Permalink

Hello OZ,

You can set necessary values manually.

In such manner, for example.

    $_GET['key'] = 'value';
    $_POST['key'] = 'value';

Thank you for feedback!

Comment actions Permalink

Heh, I can write even easily: $_GET['key']='value'; :) But it's not usable for testing completed scripts.

Comment actions Permalink

As Serge already mentioned, PHP Script run configuration is for running scripts in CLI mode where you cannot pass GET/POST parameters automatically (unless you set them in your code directly).

You can easily pass GET parameters when using PHP Web Application run configuration -- just add them to the script URL (Start URL field). In your example it will be something like:

As for POST parameters ... I guess this is the right ticket to watch:

Comment actions Permalink

I have not enough experience with running php in CL, and now I understand that this idea can not be normaly done, because of CLI restrictions.
Thanks for tips, excuse me for this stupid theme :)


Please sign in to leave a comment.