$_POST[] variable?
Richard Gaskin
ambassador at fourthworld.com
Thu Aug 2 14:45:52 EDT 2018
Tim Selander wrote:
> Is it possible to manipulate the contents of the $_Post[] global
> directly on Livecode serve?
>
> When I reload a page, the values in the array still have the values in
> them from the previous time the "Submit" button was used... efforts to
> delete or put empty into, do not seem to work.
I wonder if the problem may be that the browser is caching the result of
the last call to the CGI?
On the server side, any CGI (whether it be LC Server, PHP, Python, or
any other engine) is launched, executes, and dies with each request.
As such, environment variables can't help but be fresh, as the process
is not persistent between requests.
As a diagnostic step I would use a browser's debugging tools to watch
that request carefully.
If your API expects only LC clients without supporting generic browsers,
the detailed logging option for libURL may be helpful, using a spare
field to display some of the transaction details:
https://livecode.com/resources/api/#livecode_script/liburlsetlogfield
You may also consider the old trick of appending the URL with a random
string in the non-actionable part of the URL beyond a hash tag, e.g.:
https://someserver.com/cgi-bin/myscript.lc#123456789
...where "123456789" is the millisecs, so that each request is seen by
libURL as unique (which I believe also works with tsNet; Charles may
have additional guidance).
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list