Download on GitHub

PHPZevelop

Variable passing test

Using PHPZevelop you can pass variables through the URL in two different ways.

Option 1 - Pretty URL's

Test this option (See variables passed at bottom of page)

The page you are viewing exists here:

/help/vars.php

So when going to:

/help/vars

PHPZevelop will pass back that page. But if you pass extra "/items" to that URL they will act as parameters to that page. Note that if a page exists at that location it will choose that instead.

By default the PassParams option in "/config.php" will disable this functionality but can be turned on by setting it to true on individual pages like this one, or it can be set to true by default. for more information click here.

When using this option, you will notice at the bottom of the page that $_GET contains the parameters passed through the URL. By default they will be indexed as "param_0", "param_1" etc, but this can be changed in the global file by changing $prependParam. If $prependParam is an empty string the parameters will be indexed as a plain integer instead of text.

Option 2 - Standard format

Test this option (See variables passed at bottom of page)

After the "path" has been passed through the URL you can append variables using the pattern:

?name=value

For multiple variables use:

?name1=value1&name2=value2

You can then retrieve "value" by using $_GET["name"] inside your pages.

Below is a var_dump of all the variables passed through the current URL

array(2) {
  ["param_0"]=>
  string(1) "5"
  ["param_1"]=>
  string(4) "test"
}


© PHPZevelop 2017 - @_Zephni (Craig Dennis)