Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
en:create:functions:readget [26.11.2014 16:19] – [readGET()] alexander.ritter | en:create:functions:readget [12.03.2015 14:57] – [Notes] admin |
---|
===== Notes ===== | ===== Notes ===== |
| |
* Reading __only__ works on the first page of the questionnaire, __or__ on a page that was set up using ''[[:en:create:functions-output#option|option('resume', true)]]'' when broken, __or__ if the project administrator ensures the variable was transmitted by using an appropriate link. | * Reading __only__ works on the first page of the questionnaire, __or__ on a page that was prepared for a break using ''[[:en:create:functions:option|option('resume', true)]]'', __or__ if the project administrator ensures the variable was transmitted by using an appropriate link. |
* Certain variables have a specific meaning and should not be used to transfer user-defined data; see [[:en:survey:url|URL to the Questionnaire]]. | * Certain variables have a specific meaning and should not be used to transfer user-defined data; see [[:en:survey:url|URL to the Questionnaire]]. |
* Before using ''readGET()'', check whether a value has already been set. In the examples below, ''[[http://php.net/manual/en/function.isset.php|isset()]]'' or ''[[:en:create:functions:getroute|getRoute()]]'' is used to do so. For example, if you put a compulsory question on the first page in the questionnaire, the first page will be shown again if no answer is given, but ''readGET()'' is unable to read the value anymore. This "no value" would then overwrite the correct value already stored. | * Before using ''readGET()'', check whether a value has already been set. In the examples below, ''[[http://php.net/manual/en/function.isset.php|isset()]]'' or ''[[:en:create:functions:getroute|getRoute()]]'' is used to do so. For example, if you put a compulsory question on the first page in the questionnaire, the first page will be shown again if no answer is given, but ''readGET()'' is unable to read the value anymore. This "no value" would then overwrite the correct value already stored. |
In addition, the ID for ''pid'' is set up as the placeholder ''%pid%'' in order for it to be used later in a redirect link (e.g. %%https://www.panelanbieter.com/redirect.php?user=%pid%%%). | In addition, the ID for ''pid'' is set up as the placeholder ''%pid%'' in order for it to be used later in a redirect link (e.g. %%https://www.panelanbieter.com/redirect.php?user=%pid%%%). |
| |
Here, the use of ''[[:en:create:functions:getroute|getRoute()]]'' ensures that reading and, crucially, ''put'' is implemented at the start of the interview only. | Here, the use of ''[[:en:create:functions:getroute|getRoute()]]'' ensures that reading and, crucially, ''put'' is implemented at the start of the questionnaire only. |
| |
<code php> | <code php> |