Hi,
Is it possible to receive and process url parameters?
For example I would like to preset some controls based on passed parameters something like: -
http://127.0.0.1:9125/SpiderBasic_Compi ... 0¶m3=1
Receiving Parameters
Re: Receiving Parameters
yes:Ajm wrote:Is it possible to receive and process url parameters?
Code: Select all
EnableExplicit
Define UrlParameter.s
Define CountParams, ParamCounter
Define NameValue.s
! v_urlparameter = location.search.substring(1);
If UrlParameter <> ""
Debug "UrlParameter: " + UrlParameter
CountParams = CountString(UrlParameter, "&")
For ParamCounter = 0 To CountParams
NameValue = StringField(UrlParameter, ParamCounter + 1, "&")
Debug "Parametername: " + StringField(NameValue, 1, "=")
Debug "Parametervalue: " + StringField(NameValue, 2, "=")
Debug "------"
Next
Else
Debug "No parameters found"
EndIf@Fred: i think it's a good idea to use CountProgramParameters() & ProgramParameter() to determine the url-parameter natively.
Re: Receiving Parameters
Thank you again Peter it works perfectly.
I agree it would be nice to have the CountProgramParameters() & ProgramParameter() to determine the url-parameter natively.
I agree it would be nice to have the CountProgramParameters() & ProgramParameter() to determine the url-parameter natively.
Regards
Andy
Andy
Re: Receiving Parameters
True will be a great candidate for CountProgramParameters()/ProgramParameter()
-
Dirk Geppert
- Posts: 349
- Joined: Fri Sep 22, 2017 7:02 am
Re: Receiving Parameters
Can POST data also be read in? I receive structured JSON data that I want to transfer to the web form.
