Answer the question
In order to leave comments, you need to log in
How to pass in GET URL with spaces?
An incomprehensible situation arose: there is a site on Drupal, there is a view view, where the link should open a form in colorbox to which get passes the name of the current material.
Code example:
<a class="colorbox-load" href="/form?name=[title]">Отправить</a>
Answer the question
In order to leave comments, you need to log in
Install this module https://www.drupal.org/project/views_php
First create a php field with something like return urlencode($title);
Then substitute the value of this field instead of [title]
Use base64 . Before sending, you encode the data and when you receive it, you decode it.
If I'm not mistaken , base64 was created exactly for this purpose, in order to encode data in a URL .
Spaces are successfully replaced by the character combination "%20" which is equivalent to a space.
Further, Drupal can process get-parameters using the drupal_get_query_parameters
function
Example:
Processing a request like mysite.com/page?arg=text%20text
$get_params = drupal_get_query_parameters();
echo $get_params['arg'];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question