The query editor a versatile window that allows to create the input for testing CGI script locally, or ever sending the information to a remote URL address.
If the CGI script is used to process data from a web page, the best is to load the html page and run with the internal server and run with server and use remote debugging. However in some occasions you might need to create your own query.
- For testing many values quickly.
- To discover potential holes. Many security breaks occur by hackers sending to scripts "naughty" queries.
- The query editor is also used for console scripts, to automate sending input to them (using the POST raw encoding).
CGI Scripts can accept different kinds of information. Read about the various methods in the next section.
What the query editor affects
What you see in the preview tab is sent to scripts when:
- Running without "run with server" selected
- Starting the debugger
- Running with "run with server" selected
- Navigating to any URL when selecting Browser / Go to URL with query
Editing the GET, POST, COOKIE and PATHINFO methods
For each method go to the corresponding page and fill in the dual column grid with name & value pairs. These pairs construct queries like:
You can also edit the query manually in the manual edit box.
In both boxes you can also add the metacharacters \n \r \t.
Selecting a file for a multipart POST
In the POST tab, either in the value column or in the manual edit box, press right click and select a file to be sent.
Enabling combinations of methods
From the Methods menu, check and uncheck the methods you want to be used. If for example you want to use the POST method, make sure the item "Enable POST" is checked.
Viewing previously sent queries and saving them
You can save a query so you can access it later - do this by selecting Methods / Add values. The query will be added in the combo box of the Query menu in the main menu. To delete a previous query, select it from the combo box and press "Delete values".
All the information in the Query editor is saved when you close the script, in the active project, as long as the script is contained in the project.
Importing a form from a web page
Press the "import file" button and select the html page that has the form data. Or if the html file is being viewed in the internal browser, select "import web". The html code of the form will get parsed into the query editor.
Setting environment variables
If needed, you can fine tune common environment variables servers send to the scripts they run, from the "Environment" tab.
Previewing the result
From the preview tab you can preview what will be sent when running or debugging.
If you develop console scripts, read about how you can automate sending to <STDIN> in Running console scripts.