Passing variables from web server to HTML5 Captivate File

I am publishing a Captivate quiz as HTML5 and hosting them on a website. I would like to know how I can pass data from my site to the HTML5 based Captivate quiz.
So far I have had success getting data out of captivate by having the file POST the results of a finished quiz to a RESTful route. However, I have not had success putting data into the file. I would like to pass information such as User ids and quiz ids, maybe even current slide position so that I can associate the quiz information with my database. I am not specifically looking for a solution to user ids, quiz ids, etc. because I can get creative in that regard, I just want to know if others have been able to set variables on Captivate file load.
I have tried a setting variables in a couple ways:
- Declaring the variables with javascript, then ajax loading the page into a div. This caused dependency issues since the captivate file uses relative paths for its assets folder.
- Modifying the published html file by adding the javascript variables, this returned an error message saying I cannot override the existing captivate variables
- Adding the js variables into the init function, this had no effect.

To simply pass the username and an id I used the following.
Note the URL has query string parameters that match the captivate variables
http://mywebsite/Course/index.html?cpQuizInfoStudentID=IDHere&cpQuizInfoStudentName=Studen tNameHere
Another way to do this to use JavaScript to read the query string, and the assign variable in CP to the query string values. I remember reading some more detail, but cant remember where.
Hope it helps
Luke

Similar Messages

  • Passing variable from one server to another within different application.cfm

    hello all.
    currently , i have 3 server..
    each is installed with coldfusion server.
    let says,
    server A,server B, and server C.
    server A has the application.cfm for login.
    from server A , I want to carry the login ID to server B(also
    has application.cfm) or server C(also has application.cfm) without
    having to login again.
    Present, what I facing right now..
    server A has the application.cfm login and then direct to
    server B(also has application.cfm).
    But at server B it will request user to relogin.
    Same with server C.
    should I changed and modified the application.cfm in server B
    and C by removing 'cflogin statement'?
    I have no idea.. :chomp: :confused:
    Please anybody, help me with this..

    I'll admit I'm not the most educated on application/session
    management but I'll try and help.
    When a user logs into your CF server, it creates the session,
    which is only for that server. That's probably the issue you're
    running into when the user jumps from one server to the next. You
    might want to try using a cookie and CFTOKEN on the login (server
    A) and then use the application.cfm file on server B and C to check
    for the existence of the token. If it's there (in the client
    cookie) then it would allow them access.
    ---set the application in the application.cfm page on all 3
    servers to the same name---
    <cfapplication name="myappname"
    sessionmanagement="Yes"
    clientmanagement="Yes"
    SESSIONTIMEOUT=#CreateTimeSpan(1, 0, 0, 0)#
    setclientcookies="yes">
    ---then check for the cookie value on each server as well---
    <CFIF IsDefined("Cookie.CFID") AND
    IsDefined("Cookie.CFTOKEN")>
    <CFSET Variables.CFID_LOCAL=Cookie.CFID>
    <CFSET Variables.CFTOKEN_LOCAL=Cookie.CFTOKEN>
    <CFCOOKIE NAME="CFID" VALUE="#Variables.cfid_local#">
    <CFCOOKIE NAME="CFTOKEN"
    VALUE="#Variables.cftoken_local#">
    </cfif>
    There might be some yes/no variables in the session
    management you can set (yes on A, no on B and C) if the above does
    not work. But with the users jumping across servers, the cookie
    might be the best answer for you.
    Actually, I realized something. You would want to set the
    setclientcookies only on server A but have B and C check for the
    cookie.
    Hope some of this helps.

  • Passing variables from one swf to another

    I am facing problem to pass variable from one swf to another.
    I am using loadMovie to load another swf. how can I pass a variable
    value to another swf. Can anyone help me plz? It is somewhat
    urgent.
    thanx in advance.

    first of all:
    this is the Flash Media Server and your problem is not
    related to FMS....
    second thing related to the "somewhat urgent" :
    we, users on this forum, are not there to do your job... so
    calm down otherwise no people will answer your question. This forum
    is a free support forum that community of Flash developer use to
    learn tricks and to solve problems.
    Possibles solutions:
    If the two swf are seperate you can use LocalConnection to
    establish a connection between different swf.
    If you load a second swf into the first one you can interact
    like a standard movieClip(only if there from the same domain or if
    you a policy file on the other server)
    You can use SetVariable(via Javascript) to modify a root
    variable on the other swf and check with an _root.onEnterFrame to
    see if the variable had changed in the second swf.
    * MovieClipLoader will do a better job, in your specify case,
    than the loadMovie. Use the onLoadInit event to see when the swf is
    really totaly loaded into the first one otherwise you will have
    timing issues.
    My final answer(lol) is the solution 2 with the
    notice(*)

  • Passing variables from AS3 to PHP

    Hi there
    I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].
    I've stuck with this for two days.. Here's what I have done. Please help!!!
    header.fla [Actionscript in the timeline]
    stop();
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.net.*;
    var url:String = "http://localhost/0000/try.php";
    var req:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    var variables:URLVariables = new URLVariables();
    send_btn.addEventListener(MouseEvent.CLICK, sendForm);
    function sendForm(evt:MouseEvent):void
        // add the variables to our URLVariables
        variables.asd = "value";
        // send data via post
        req.method = URLRequestMethod.POST;
        req.data = variables;
        loader.dataFormat = URLLoaderDataFormat.TEXT;
        // add listener
        loader.addEventListener(Event.COMPLETE, onLoaded);
        loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        //send data
        loader.load(req);
    function onLoaded(evt:Event):void
        var result_data:String = String(loader.data);
        if (result_data)
            trace(result_data);
        else if (!result_data)
            trace("error");
    function ioErrorHandler(event:IOErrorEvent):void
        trace("ioErrorHandler: " + event);
    try.php
    <body>
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="563" height="280">
      <param name="movie" value="header.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="../Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="header.swf" width="563" height="280">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="../Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <?php
    if($_POST['asd'])
    echo "value of var1 is <b>".$_POST['asd']."</b>";
    else
    echo "bad luck";
    ?>
    </body>
    BIG THANKS!!

    the problem is nothing your showed.   did you see a security warning that you ignored?
    to test, if that's the problem go here and adjust your security settings:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    if that fails, upload your files to a server and confirm everything works.  then start working on your local configuration.

  • OBIEE 11g How to pass variable from one prompt to another prompt in dashboard page.

      How to pass variable from one prompt to another prompt in dashboard page.
    I have two prompt in dashboard page as below.
    Reporttype
    prompt: values(Accounting, Operational) Note: values stored as
    presentation variable and they are not coming from table.
    Date prompt values (Account_date, Operation_date)
    Note:values are coming from dim_date table.  
    Now the task is When user select First
    Prompt value  “Accounting” Then in the
    second prompt should display only Accounting_dates , if user select “operational”
    and it should display only operation_dates in second prompt.
    In order to solve this issue I made the
    first prompt “Reporttype” values(Accounting, Operational) as presentation
    values (custom specific values) and default presentation value is accounting.
    In second prompt Date are coming from
    dim_date table and I selected Sql results as shown below.
    SELECT case when '@{Reporttype}'='Accounting'
    then "Dates (Receipts)"."Acct Year"
    else "Dates (Receipts)"."Ops
    Year"  End  FROM "Receipts"
    Issue: Presentation variable value is not
    changing in sql when user select “operation” and second prompt always shows
    acct year in second prompt.
    For testing pupose I kept this presentation
    variable in text object of dashboard and values are changing there, but not in
    second prompt sql.
    Please suggest the solution.

    You will want to use the MoveClipLoader class (using its loadClip() and addListener() methods) rather than loadMovie so that you can wait for the file to load before you try to access anything in it.  You can create an empty movieclip to load the swf into, and in that way the loaded file can be targeted using the empty movieclip instance name.

  • Need Help Streaming Video From Web Server Built Into Application - Linksys WRT54g Router

    Very much appreciate any help getting streaming video feed from web server built into video application to work properly using port forwarding on my Linksys WRT54g wireless router.
    Here is the situation:
    My PC is connected to the internet via a Linksys WRT54g wireless router.
    The Windows XP Pro SP2 firewall is enabled, with a firewall exception established for the video camera application.
    On the router, forwarding of port 80 is enabled for the LAN IP address of the PC running the video application with an embedded web server, and the web server in the video camera application is also set to use port 80.
    I have a free DYNDNS account and also run the DYNDNS updater program on the PC running the video application with embedded web server. According to the DYNDNS web site and the DYNDNS updater program, the IP address assigned to the machine running the video application with embedded web server is set correctly in my dyndns account.
    When I open a browser (Explorer or Firefox) on the PC running the video camera application with embedded web server, I am able to  connect to the video application's web server by going to the dyndns address linked to the machine running the video application. The video application's web server is set to use the dyndns address. That's the good news. The bad news is that I can't connect to the video application's web server from any machine that connects to the internet that uses a router other than the router used by the PC running the video application. I am only able to connect to the streaming video from the application's web server only on machines that connect to the internet using the same (home) router used by the PC that is running the video application.
    Since I am able to connect to the video app's embedded web server successfully on the machine running the video application, it seems that at least something about the current port forwarding settings is correct. For example, if I uncheck 'enable' for forwarding of port 80 on the router settings page, I am no longer able to connect to the video app's web server when I try to do so in a browser running on the machine running the video app. When I re-enable port 80 forwarding on the router, I am again able to connect to the web server of the video application on the machine running the video app. I thought that by enabling forwarding of port 80 on the router and associating that port with the LAN IP of the machine running the video application, it would be possible to connect to the streaming video of the video app's embedded web server from ANY machine connected to the internet, but that is not the case. There must be some other router settings to update/change in order to get the port forwarding working to enable a successful connection to the video web server, but I am stumped. Very grateful for any suggestions as to how to get this working properly.
    Thanks in advance...

    The firewall log can be configured on the third tab in the window for the firewall settings, where you can turn the firewall on and off completely.
    From your tests, though, it does not seem to be the firewall. However, to be sure, it would be good to check the log. It will help to eliminate the firewall as the culprit and you may find it handy in the future, too. ;-) Just don't forget to turn the log off again after you are done because it may cause some performance penalty on your system while on.
    From what you write, it seems as if I should give a little networking background on the ip addresses you'll see. Your setup is (or should be) a modem connected to the WAN/Internet port of the WRT. The computer is connected into a LAN port of the WRT.
    Your router has two IP addresses (that's what makes it a router): a WAN address and a LAN address. The WAN address is the address assigned by the ISP. It is a normal internet IP address. Everyone is able to send packets to this IP address. The WAN address is the one reported by whatismyipaddress.com, it should be listed in the dyndns record and it is the address that your router shows on the Status page. It's the public IP address of your router. Dyndns maps your dyndns.org name to that IP address.
    Your router also has an IP address on the LAN side. You can configure it to be whatever you want. The default is 192.168.1.1 with netmask 255.255.255.0 and it is better to leave it like that or at least inside the network 192.168.*.*. 192.168 is a special, reserved IP address range for private networks. Basically, routers in the internet are not supposed to forward addresses in this range. That makes them suitable for private LANs as the packets never can get anywhere. Most people using Linksys routers have there LAN in 192.168.1.*.
    The router acts as gateway, which means it forwards packets from PCs in the LAN to the internet and back. As all your PCs in your LAN share a single WAN IP address, the gateway does address translation (NAT). This works only in one direction: from the inside to the outside. The router remembers when a PC in your LAN sends something out and accepts the responses in and sending them back to the PC. If something comes in from the internet which cannot be associated with a ongoing communication the packet is dropped unless you use port forwarding.
    All computers in your LAN either have a static IP address assigned or use DHCP to get it automatically. The router has a DHCP server as well which gives out IP address from 192.168.1.100-149 if not changed. With a router with default settings static IP addresses can be in the range of 192.168.1.2-99 and 150-254.
    ipconfig /all reports your IP address in your LAN, i.e. an address 192.168.1.*. The gateway in this output should be 192.168.1.1 which is your router. And packet no in the LAN address range 192.168.1.* is send to the router which forwards the packets into the internet.
    An address 192.168.1.* should not appear as internet address in the Status page of the router nor should it appear at dyndns.
    Port forwarding is used to operate a server in the LAN. By default, a server in the LAN cannot be reached from the internet. You have to configure port forwarding for this. You configure that traffic bound for a specific port (e.g. TCP port 80 for http) on your WAN IP address is forwarded to the same port on a specific LAN IP address. If your server runs on 192.168.1.50 than traffic to your WAN IP address port 80 is forwarded to 192.168.1.50 port 80. That way your HTTP server can be reached from the internet. As you can only configure a fixed IP address in port forwarding it is recommended that the server uses a static IP address and not DHCP as in the latter case the IP address may change over time...
    O.K. so much for networking. I hope that makes things a little clearer and you can verify that your setup is how it is intended to be.
    I suggest the following: on the router's security page there is an option to block WAN requests. Remove the check if it is set (meaning: do not block). After you did that change you should be able to ping your WAN address (e.g. ping xxxx.dyndns.org) from the internet. That way we know that it is on the correct address.
    Also on the Administration page make sure that remote management is disabled (should be like that per default) or that the management port is NOT 80 but for example 8080. What is your your UPnP settings on the same page?
    O.K. that should be enough for the moment...

  • Is it possible to pass variables from Tidal to the Peoplesoft run controls?

    Does anyoen know
    •1) Is it possible to pass variables from Tidal to the Peoplesoft run control page such as current date?
    An example would be updating run control parameters for a PSQUERY.
    •a) From date
    •b) To date
    •c) Business units
    Thanks,
    Jay

    Edit the job - go to Run Controls Parameters tab - select the param you want in the Override column then click on the Variables button on the bottom and select the variable you want

  • Error when passing data from app server...

    Hello Experts,
    I am encountering an error when trying to pass data from application server
    to my internal table. Below is the error:
    "You cannot convert the character set"
    Hope you can help me guys.Thank you and take care!

    Hi  ,
    ABAP code for uploading a TAB delimited file into an internal table. See code below for structures. The code is base on uploading a simple txt file.
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    constants: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload TO it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.
    Reward  points if it is usefull ..
    Girish

  • Passing variable from one JSP to another

    Hi....
    I am working on customizing Oracle Application(istore).
    I need to pass variable from 1 JSP to another.
    JSP 1 contains the following line of code:
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    How can I pass this to another JSP Page. The other JSP should take the 'soldtoCustPartyName' and find out the primary address country.
    So please help me in getting variable passed from 1st JSP to next.
    By default, 1st JSP is not fwded to 2nd JSP.
    This is very very urgent...Please help.....

    When you push the submit button on jsp1 - it goes to jsp2?
    ie
    // in jsp1.jsp
    <form action="jsp2.jsp">
    <INPUT type="HIDDEN" name="soldtoCustPartyName" value="<%=soldtoCustPartyName%>">
    <input type="submit">
    </form>
    //Then in jsp2.jsp all you need is
    request.getParameter("soldtoCustPartyName");This will pick up the value that is coming from the hidden field on jsp1

  • Passing variables from one jsp to another

    Hi All,
    I've searched thru the forum and can't find an answer to a prob I'm having, trying to pass a variable from one jsp to another.
    in file searchBar.jsp i have
    <%
    String archiveSearch = "off";
    %>
    and
    <%
    if (userUtils != null && userUtils.getSearch().equals("on"))
    %>
    <a href="/webLayout/webSideBar.jsp?searchState=<%=archiveSearch%>onclick="archiveSearch = "on""></a>
    and in file webSideBar.jsp
    <%
    String searchState = "off";
    String archiveSearch = (String)request.getParameter("searchState");
    %>
    basically it will give me a variable archiveSearch set to on in webSideBar when the user clicks on the search button, but as it is it's not passing the variable from the searchBar.jsp to the webSideBar.jsp and I think it looks ok !!!! but it's not
    Help

    Looks good to me as well.
    Couple of suggestions
    1 - view source on searchbar.jsp - see what the generated source code for that link is
    2 - Look at the url used to generate webSideBar.jsp. If its not in the address bar, right click the webSideBar page and choose properties.
    Check to see what parameter was passed.
    Are these pages in a frameset? Do you have to specify a target frame for your link?

  • EVDRE encountered error retrieving the data from web Server

    Hi,
    I know this is the common/generic error message, following is our scenario:
    We installed BPC NW 7.5 on our production box and configured F5 load balancing for two .NET servers.
    We are getting the error "EVDRE encountered error retrieving the data from web Server"when we run the report EVDRE on APSHELL (original Appset). This is the fresh installation:
    The workaround "Clear Local application information". Even this works only sometimes.
    Is there anything else we should have configured on using two .NET servers?
    Please suggest.
    Thanks

    hi Nagesh sorry for the delayed reply..
    We changed some of the parameters at F5 switch like sticky time, timeout..
    And the MDXPARSER connection to one of out application server was failling, thats why we did not had this issue consistently.
    When ever the request goes to that app server fails. It took a lot effort to notice this since we were assuming the F5 switch was only causing the issue.
    Thanks

  • No response from Web Server

    Hello,
    I have installed Oracle9i application server Rel 2,9i Infrastructure & oracle 8i DB on Win 2000 server.The installation was successful.
    When I access the browser with http://<hostname>:7777 it works fine, it shows HTTP server welcome page.
    Now I am trying to access Portal home page using http://<hostname>:7779/pls/portal
    It seems, it searches for the Web site for sometime & then gives the error "No response from Web Server"
    What is the problem ?? Is there anything with the services ?? I can see two http servers(apps & infrastructure)in the program listing,is it related with these ??
    Please help.I will appreciate your support.
    Regards
    Sandeep

    Hi Sandeep.
    Try run EM WebSite running in http://&lt;hostname&gt;:1810.
    If you are familiarized with this service it should be easy to solve your problem.
    Once you access EM WebSite, you'll see two farms(One for iasdb, and one for Portal). That are some symbols that tell you about the status of Portal. If You see an red arrow pointing down, then you need to access Portal farm to put some services "up".
    Choose the link for Portal Farm.
    This page shows the status of all Portal components.
    For you to get response from your portal http server, there a few of these that must be working.
    They are (by order):
    1. OC4J_Portal;
    2. Web Cache;
    3. HTTP Server;
    For you to start them, you must (for each one) click on it's radio button an choose start.
    With this components "up" you should be able to access Portal.
    Some of other components cannot be started by us, because it's radio button is disabled, but Single Sign-On:orasso:7777 must be "up", and
    Portal:portal:7778 in my case is "down". The rest of OC4J components are needed for other utilities like deploying components.
    Hope i helped you.
    Pedro.

  • No response from web server after a process ran for 1-2 minutes

    Hi,
    I have a proven pl/sql code, it took about 2+ minutes to complete in sqlplus.
    But when I created a button to process the exactly same code in APex application, the process runs about 2 minutes and
    applications bombs with this msg "No Response from web server".
    Has anyone gotton this msg before?
    Thanks,
    Julie

    Hi Julie,
    See this thread - it may had some extra considerations for you: OHS Webserver Timeout for long running requests
    Do you know if your error message is returned at a fixed time each time? You could test this by creating a procedure that sleeps for X amount of time and then vary X to see if you can find a cutoff point for losing the connection.
    Also - I assume that your process keeps running on the database, despite the webserver connection being lost?
    If it's not a limitation in your httpd.conf file (the default is 5 mins as others have pointed out), then perhaps your network colleagues have set something in your network configuration to kill connections longer than a certain period of time? This is what happened in my case.
    Hope this helps.
    Alan

  • Passing variables from php to flash and the opposite

    Hi guys, im trying weeks now to solve this problem but nothing yet
    If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!

    I have recently had to learn this, so this may not be the best way but it worked for me
    I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
    have a go and post any problems here and I'll try and help
    in flash i have
    private function getBalanceAndXP():void
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "getBalance";
              variables.fbid = userID;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.addEventListener(Event.COMPLETE, onBalanceComplete);
              loader.load(request);
    private function onBalanceComplete(e:Event):void
              var loader:URLLoader = e.target as URLLoader;
              loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
              var variables:URLVariables = new URLVariables(loader.data);
              _balance = parseInt(variables.balance); // class variable
              _experience = parseInt(variables.experience); // class variable
    public function setBalanceAndXP(balance:int, experience:int):void
                _balance = balance;
              _experience = experience;
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "setBalance";
              variables.fbid = userID;
              variables.balance = _balance;
              variables.experience = _experience;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.load(request);
    and then I have my php file
    <?php
    $func = $_POST["func"];
    $fbid = $_POST["fbid"];
    $balance = $_POST["balance"];
    $experience = $_POST["experience"];
    $numVariables = 0;
    $link = mysql_connect("localhost","username","password");
    mysql_select_db("databaseName");
    if ($func == "getBalance")
              getBalance($fbid);
    else if ($func == "setBalance")
              setBalance($fbid, $balance, $experience);
    mysql_close($link);
    function getBalance($fbid)
              $query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
              $result = mysql_query($query);
              $row = mysql_fetch_row($result);
              writeVariable("balance", $row[0]);
              writeVariable("experience", $row[1]);
    function setBalance($fbid, $balance, $experience)
              $query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
              mysql_query($query);
    function writeVariable( $name, $value )
              global $numVariables;
              if ( $numVariables > 0 )
                        echo "&";
              echo $name . "=" . urlencode($value);
              $numVariables++;
    ?>

  • Passing variables from Applescript to bash

    Hello,
    I'm trying to pass variables from Applescript to bash using the following code
    #!/bin/bash
    osascript <<EOF
    tell application "SystemUIServer"
    set username to text returned of (display dialog "Enter your name" with icon caution default answer ""  buttons{"Continue"})
    set macname to text returned of (display dialog "Enter name of your Mac" with icon caution default answer ""  buttons{"Continue"})
    do shell script "export USERNAME=" & quoted form of username & " && export MACNAME=" & quoted form of macname
    end tell
    EOF
    echo "USERNAME is $USERNAME, MACNAME is $MACNAME"
    but no luck
    Mac-mini:Downloads admin$./new.command
    USERNAME is , MACNAME is
    Any help would be greatly appreciated.

    I just realized you are returning 2 variables.  That can still be handled by echoing/printing the values, you just have to parse the output, or use other tricks.
    VALUES=( $(osascript -e '...') )
    This would make VALUES an array, with each array element containing one space separate return value from osascript
    USERNAME=${VALUES[0]}
    MACNAME=${VALUES[1]}
    If USERNAME or MACNAME could have spaces in them, you would need to use some kind of separator character.  For example if you use @ as the separator you could do something like:
    VALUES=$(osascript -e '...')
    USERNAME=${VALUES%@*}
    MACNAME=${VALUES#*@}
    which will %@* will delete everything starting with the @ til the end of the string, and #*@ will delete everything from the beginning of the upto and including the @.
    Another trick is to have the return values be properly formed shell variable assignments such as
    print "USERNAME='your user name' MACNAME='Your Mac Name' " -- I'm making this up as I do not really know Applescript, so you will have to figure out how to get Applescript to print something that looks like
    USERNAME='your user name' MACNAME='Your Mac Name'
    In your shell script you have code that looks like:
    VALUES=$(osascript -e '...')
    eval $VALUES
    The eval will execute whatever is stored in $VALUES, and if that happens to look exactly like shell variable assignments, you get the variables created in the current shell context, where can use them.

Maybe you are looking for

  • Windows 7 on bootcamp want to reinstall with out reformating the whole thing

    if im using windows 7 pro on macbook via bootcamp if i reinstall windows 7 with ulimate disc can i revert back to windows 7 pro with my product key and if i reinstall windows will i have to re partition because i dont wanna reinstall logic if so just

  • Call function within rfc

    Hi, i´ve developed an RFC FM and within this FM i use     CALL FUNCTION ' NUMBER_GET_NEXT' in order to get a sequential number each time the FM is called. When this RFC FM is called from XI i get exception 1 (INTERVAL_NOT_FOUND)  Why is this happenin

  • Calling report within parameter form

    I am using web.show_document to call a report with paramform=yes and desformat=spreadsheet. The users wanted the output to be displayed in excel rather than internet explorer so this was achieved by these PC settings control panel > folder options >

  • Could not load file or assembly 'Oracle.DataAccess, Version=2.111.7.20,

    can any one provide a patch or way around on windows 7 64bit amd, for odp.net 11g, as the policy doesnt dot get registered for amd64 bit platform in c:/windows/assembly, one can see policy for 'Oracle.DataAccess 2.111.7.20 0n x86 but not for amd64. h

  • SPM 3.0 GA

    Hi, When SPM 3.0 is going to be in General Availability. What is the experience of SPM 3.0 with ramp up customers. Pls sha