- Posts: 36
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Can I change the URL Parameters ?
- OngJunYew
- Topic Author
- Offline
- Junior Member
Less
More
3 years 9 months ago #202374
by OngJunYew
Can I change the URL Parameters ? was created by OngJunYew
Hi,
I just want to know can i shorter my URL paramters from "http://localhost/survey/11?token=zxc123&lang=en" to something like this "http://localhost/survey/11?=zxc123" ?
- delete the token text from the url
- delete the lang=en from the url
Thank You
I just want to know can i shorter my URL paramters from "http://localhost/survey/11?token=zxc123&lang=en" to something like this "http://localhost/survey/11?=zxc123" ?
- delete the token text from the url
- delete the lang=en from the url
Thank You
The topic has been locked.
- jayat
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
3 years 9 months ago #202380
by jayat
Replied by jayat on topic Can I change the URL Parameters ?
Hi,
you can delete the lang from the url ( i do this often becouse i have only one language)
you need the token to start the survey or you make the survey avalibel for all
regards
jan
you can delete the lang from the url ( i do this often becouse i have only one language)
you need the token to start the survey or you make the survey avalibel for all
regards
jan
The topic has been locked.
- OngJunYew
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 2
3 years 9 months ago #202382
by OngJunYew
Replied by OngJunYew on topic Can I change the URL Parameters ?
Hi, thanks for your reply
Basically, I need to run my survey with token and two different language. Will I able to shorten the URL as have stated ?
Thank You
Basically, I need to run my survey with token and two different language. Will I able to shorten the URL as have stated ?
Thank You
The topic has been locked.
- jayat
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
3 years 9 months ago #202383
by jayat
Replied by jayat on topic Can I change the URL Parameters ?
if you delete the token part the user must type in the token to start the survey and so he need the token
without the language it starts with the main language of the survey (i think) when the user can change the language he can decide
I don’t know the test setting but maybe you can use a QR code to start the survey
Or you can use short url for each token
without the language it starts with the main language of the survey (i think) when the user can change the language he can decide
I don’t know the test setting but maybe you can use a QR code to start the survey
Or you can use short url for each token
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 9 months ago #202384
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can I change the URL Parameters ?
No,
because you may add several parameters, the application has to know to which variable the value belongs.
As you may change the order of parameters, the name of the parameter is necessary
Like
survey.mylime.com/123123?lang=de&newtest=Y&token=abc&myParam=ZZZ111
survey.mylime.com/123123?token=abc&myParam=ZZZ111&newtest=Y&lang=de
So not shorter than "survey.mylime.com/123123?token=abc"
Regarding the language:
If you have the language of the participants in the participant table it's not necessary to add it to the url.
The survey starts with the language of the participant table.
Joffm
because you may add several parameters, the application has to know to which variable the value belongs.
As you may change the order of parameters, the name of the parameter is necessary
Like
survey.mylime.com/123123?lang=de&newtest=Y&token=abc&myParam=ZZZ111
survey.mylime.com/123123?token=abc&myParam=ZZZ111&newtest=Y&lang=de
So not shorter than "survey.mylime.com/123123?token=abc"
Regarding the language:
If you have the language of the participants in the participant table it's not necessary to add it to the url.
The survey starts with the language of the participant table.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- OngJunYew
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 2
3 years 9 months ago #202421
by OngJunYew
Replied by OngJunYew on topic Can I change the URL Parameters ?
Hi,
Then is there anyway to delete the language parameters from the URL? Because I have the language of the participants in the participant table.
Thank You
Then is there anyway to delete the language parameters from the URL? Because I have the language of the participants in the participant table.
Thank You
The topic has been locked.
- OngJunYew
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 2
3 years 9 months ago #202426
by OngJunYew
Replied by OngJunYew on topic Can I change the URL Parameters ?
Hi,
Is there any solution to change the variable name "token" to another variable name as well such as only one alphabet "t".
Thank You
Is there any solution to change the variable name "token" to another variable name as well such as only one alphabet "t".
Thank You
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
3 years 9 months ago #202430
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Can I change the URL Parameters ?
If you use apache (seems to be) : you surely can use rewrite , maybe something like this 123123-XXXX rewritten to sid=123123&token=XXXX
httpd.apache.org/docs/current/en/rewrite/intro.html
Else you can update your config to manage the rules of the url manager
www.yiiframework.com/doc/blog/1.1/en/final.url
httpd.apache.org/docs/current/en/rewrite/intro.html
Else you can update your config to manage the rules of the url manager
www.yiiframework.com/doc/blog/1.1/en/final.url
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12941
- Thank you received: 3979
3 years 9 months ago #202433
by Joffm
You read my answer?
And your second question:
I could imagine you have to change the source code.
As I don't know why you want to do this, you could workaround by:
create a small php programm - called "index.php" in subfolder "s".
Reach by "localhost/s/?t=ABCabc" (and this is really short)
this only grabs the t-parameter and calls your survey with the correct syntax.
Rough example - without validation
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Can I change the URL Parameters ?
Then is there anyway to delete the language parameters from the URL? Because I have the language of the participants in the participant table.
You read my answer?
If you have the language of the participants in the participant table it's not necessary to add it to the url.
The survey starts with the language of the participant table.
And your second question:
I could imagine you have to change the source code.
As I don't know why you want to do this, you could workaround by:
create a small php programm - called "index.php" in subfolder "s".
Reach by "localhost/s/?t=ABCabc" (and this is really short)
this only grabs the t-parameter and calls your survey with the correct syntax.
Rough example - without validation
Code:
<?php //SurveyID is hardcoded $surveyID=123456; if (!isset($_GET["t"])) { $token=$_GET['t']; header ("Location: https://survey.myLimeserver.com/".$surveyID."?token=".$token); ?>
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- OngJunYew
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 36
- Thank you received: 2
3 years 9 months ago #202436
by OngJunYew
Replied by OngJunYew on topic Can I change the URL Parameters ?
Hi joffm,
Thanks for your reply.
I already figure it out how to delete the lang="en" parameter in the URL and the Survey will show the page based from the language of the participants in the participant table.
Now I just hope that I can make the variable name "token=" to something shorter such as "t=" to have a short and clean URL.
Thank You.
Thanks for your reply.
I already figure it out how to delete the lang="en" parameter in the URL and the Survey will show the page based from the language of the participants in the participant table.
Now I just hope that I can make the variable name "token=" to something shorter such as "t=" to have a short and clean URL.
Thank You.
The topic has been locked.