I've found a post which explains how to pass a parameter/argument/referer to webform.
It works fine, but I get an ugly URL. Is there any way to do this using a clean URL? I mean without using GET parameters.
I've found a post which explains how to pass a parameter/argument/referer to webform.
It works fine, but I get an ugly URL. Is there any way to do this using a clean URL? I mean without using GET parameters.
You could solve this using mod_rewrite in your .htaccess
file. Try something like
RewriteCond %{REQUEST_URI} ^/path/to/your/webform/(value)$
RewriteRule ^.*$ /path/to/your/webform?param=%1 [L]
This way you can do many things but you can't configure that with the drupal UI. Here's an example with more paramters:
RewriteCond %{REQUEST_URI} ^/path/to/your/webform/(value1)/(value2)/(.*)$
RewriteRule ^.*$ /path/to/your/webform?param1=%1¶m2=%2¶m3=%3 [L]
Check out the manual.
EDIT: your comment example should look something like that:
RewriteCond %{REQUEST_URI} ^/myform/(\d+)$
RewriteRule ^.*$ /myform?i=%1 [L]
The exact regex at the end depends on your parameters. If you expect only numbers like 1
or 0125
\d+
should be fine. Check out this cheatsheet for more/other char-classes and regex stuff.
Drupal strictly recognize the q
i.e. $_GET['q']
as the page path otherwise redirects to Page Not Found page. Passing the arguments as part of q
, Drupal menu system must be aware of such arguments place holders. And there arguments can be accessed by arg([arg-index])
Passing extra unregistered parameter to any page is only possible by additional GET variables beside q
and can be accessed by PHP's regular way. i.e. $_GET global array