Announcement

Collapse
No announcement yet.

sc_redir passing and receiving parameter

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    That's right and very logical. sc_redir does - as the name says - a redir, it handles the control over to another php application. It's not a call to a procedure. This is standard php and the real thing would be to use global variables like:

    sc_redir(gridb,returnto=myapp.php);

    in your called application (not modal, I haven't tested that)

    sc_redir([returnto], retrieved={myvalue});
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #17
      Since all Scriptcase apps are based on database, I'm finish this like:
      1. Before sc_redir, create a key(like a GUID) and pass that key to the sc_redir as a parameter;
      2. On the redired page, write to a table with a key passed in (that GUID);
      3. After return to the origin page, search the table with the key(that GUID) and do the next step;

      That's my solution.

      Comment


      • #18
        To avoid data garbage you can consider using a temporary table. Personally I would go for my option as you can serialize an array of data into a single variable.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #19
          I was hopping to find my answer here based upon the question. Please advise:
          I have the following that calls an SMS API, which returns a Result either 1 (successful) or -1 (unsuccessful).

          sc_redir(https://abc.com/trigger_sms.php?phone=$phone&msg=$message,"","");

          How do I get the result into a variable please?

          Comment


          • #20
            This is not the way to go. sc_redir will pass control to another url, it is not a function call. A right way might be:

            $myresultg = file_get_contents("https://abc.com/trigger_sms.php?phone=$phone&msg=$message,'',''");
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #21
              Thanks Albert
              Just about there. I got it to work but the value of $message (which is a text message message), only the 1st characters are being sent. I tried looking up file_get_contents(), but didn't quite understand how to apply $maxlen (that's what i thought the problem was). So I tried another example shown in the help and that is as per below. Unfortunately that still only sent through the 1st 2 characters of $message
              $myresultg = file_get_contents("https://abc.com/trigger_sms.php?phone=$phone&msg=$message",NULL, NULL, 0, 255);

              Your guidance here is very much appreciated.

              Larry

              Comment


              • #22
                maybe you should urlencode the message

                Comment


                • #23
                  Excellent, it worked. Thanks a bunch

                  Comment

                  Working...
                  X