Passing Variables in a non-CGI LC Server?

Matthias Rebbe matthias_livecode_150811 at m-r-d.de
Fri Apr 7 02:03:41 EDT 2017



> Am 07.04.2017 um 04:46 schrieb Rick Harrison via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>:
> 
> Hi Richard,
> 
> Ok, let me clarify if I can.  LC Server as it
> is installed out of the box without setting
> it up as it used to be set up in the old days.
> 
> I have three webpages.  The first accepts
> the user’s input into various fields and then
> passes that information to the next webpage
> through the user's web browser.  
> That works fine.  Then without writing those parameters
> out to a database, I want to pass those
> now hidden parameters to the next webpage
> for further processing before writing those
> values out to the database.  

is the third website just for further processing w/o an output to the user or do you also want to output some information to the user?

case 1
You could use the http post or get method to pass the parametesr to the 3rd script/website from the 2nd script and return the result then to  the 2nd script.
Be aware that your 2nd scrip or better said every lc script, needs to do an output, even if it´s just a blank. Otherwise the server returns an error 500

case 2
 If i remember right, put header allows you to redirect. So in your 2nd script/website after you´ve done whatever you could use put header to redirect using put header:

something like this
put "http://yoursite.com?param1&param2&parame <http://yoursite.com/?param1&param2&parame>" into tURL
put  header "Status: 301”
put header "Location:" && tURL
put “redirecting…”   — i am not sure if this last line is still needed, but in older versions of lcServer it was.


Matthias




> 
> How are people handling that process?  
> Or am I forced into writing everything out 
> to the database and then reading it all 
> back in just to go from one page to the next 
> to the next?
> 
> Thanks,
> 
> Rick
> 
>> On Apr 6, 2017, at 6:52 PM, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>> wrote:
>> 
>> Rick Harrison wrote:
>> 
>>> So the answer is - only in a stack.
>>> Perhaps the dictionary should have
>>> a comment stating or clarifying that fact.
>> 
>> Mike said:
>> 
>>  Can't answer the rest, but as for the global.. Since you can utilize
>>  stacks with server, you could declare a global just as you would
>>  normally, in any scripts that needed it, and it would work just like
>>  in lc proper.  It would only persist during the run of that
>>  particular instance.
>> 
>> LiveCode globals are available to all scripts that declare them within the LiveCode process.
>> 
>> I think maybe the reason Mike's reply was focused on stacks is that it's not clear what you're doing.
>> 
>> Your original post said:
>> 
>> I have a few variables I would like to pass from one <?lc..
>> server script to another using a web  browser with an lc
>> server that is not configured to be a cgi server.
>> 
>> Since LC Server runs as a CGI, and even if you were using a standalone on the server as a daemon it would still be on the server and not in the client browser, I can't figure out what that sentence means.
>> 
>> -- 
>> Richard Gaskin
>> Fourth World Systems
>> Software Design and Development for the Desktop, Mobile, and the Web
>> ____________________________________________________________________
>> Ambassador at FourthWorld.com <mailto:Ambassador at FourthWorld.com>                http://www.FourthWorld.com <http://www.fourthworld.com/>
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list