Strange variables retrieved from php script

Hi,
I am experiencing a really strange thing when making my flash
movie communicate with a php script.
No matter what the animation is doing, just consider the
following :
see code below
ticket is the object which receives the response from server
which returns
echo utf8_encode("reponse=ok")
Each time when I run it , (ticket.retour.toString() != "ok")
returns true, and the redirection url shows the following :
http://xx.yy.zz.uu/jeu_avertissement.php?type=PROBLEME_CONNECTION&retour=ok&d=0.02&u=1&k=7 39f4db19af87cc0f2b72a6f63698500
showing value of my retour var which is equal to .... ok
I really don't understand! Could anybody explain me what
happened. It looks like I saw a UFO.
Thanks in advance,
Pascal

Damn it i found :D
i had to write :
for (i=0; i<_root.tab_result.liste_lenght; i++) {
myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
I just hope it could help someone else ahahha
Bye ;)
Séb.

Similar Messages

  • Receiving variables back from php

    basicaly i have narrowed it down to this code
    stop();
    ////// Assign a variable name for our URLVariables object
    var variables:URLVariables = new URLVariables();
    var varSend:URLRequest=new URLRequest("create_member.php");
    varSend.method=URLRequestMethod.POST;
    varSend.data=variables;
    //////// Build the varLoader variable
    var varLoader:URLLoader=new URLLoader  ;
    varLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
    trace(varSend.data.status);
    trace(varLoader.data.status);
    As silly as it sounds, i need the trace to see the error.
    I am using cs4 for this and have not found anything so far to explain why it is not working.
    You can test it out without needing anything on stage.
    This is the error i get and do not know why.
    undefined               is the varSend trace
    TypeError: Error #1010: A term is undefined and has no properties.
    at Untitled_fla::MainTimeline/frame1()              is the varLoader trace
    I need this fixed, but cant find why it is doing it. Any ideas would be greatly accepted.

    There is a full script as well, but I still only get the errors stated. Basicaly I am unable to get any variables back from PHP. They show up an a standard browser window, but that is no good to me. My site is 100% flash and i need to receive data so that i can log people in, retreive their names and info, send custome messages to people on the site or even if only visitors. Without flash seeing the data correctly, I cant do squat.
    if (event.target.data.returnBody=="") {
    output_txt.text="No data coming through";
    } else if(event.target.data.returnBody!=="") {
    output_txt.condenseWhite = true;
             output_txt.htmlText = ""+ event.target.data.returnBody;
      gotoAndStop("_end");
    trace(varLoader.data.status)
    If i only use    --     event.target.data     I do get the info in, but with all the mish-mash that comes with it
    e.g.
    %0A%20%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%3Ch2%3EOne%20Last%20Step%20%2D%20Activate%20through%2 0Email%3C%2Fh2%3E%3Ch4%3EOK%20peter%2C%20one%20last%20step%20to%20verify%20your%20email%20 identity%3A%3C%2Fh4%3E%3Cbr%20%2F%3E%0D%0A%20%20%20In%20a%20moment%20you%20will%20be%20sen t%20an%20Activation%20link%20to%20your%20email%20address%2E%3Cbr%20%2F%3E%3Cbr%20%2F%3E%0D %0A%20%20%20%3Cbr%20%2F%3E%0D%0A%20%20%20%3Cstrong%3E%3Cfont%20color=%22%23990000%22%

  • Dynamic xml from php script throws error: #1088 or #1085

    Hi,
    I'm importing xml formatted data from mysql via php script:
    [code]
    <?php
    require_once('require.php');
    $result = mysql_query("SELECT * FROM `songs`");
    if($result)
        header ("Content-Type: text/xml");
        echo"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
        echo"<songComments>\n";
        while ($row = mysql_fetch_array($result))
            echo"<testimonial>\n";
            echo"<songComment>" . $row['title'] . "</songComment>\n";
            echo"</testimonial>\n";
        echo"</songComments>\n";
    ?>
    [/code]
    In one of my flash projects it's working just fine. But in the new one that I just sterted not anymore. And i have no idea why. I get this errors:
    TypeError: Error #1085: The element type "songComments\n" must be terminated by the matching end-tag "</songComments\n>".
    or:
    TypeError: Error #1088: The markup in the document following the root element must be well-formed.
    When I output that php into txt file and loaded in flash everything is fine, but not from php script directly.
    Could it have something to do with that I'm testing that mysql locally on my computer using WAMP ? Previous project got all data from mysql from server.

    Ho could I trace what flash sees?
    var url:URLLoader = new URLLoader();
    url.addEventListener(Event.COMPLETE, xmlLoaded);
    url.load(new URLRequest("getDataFromDB.php"));
    private function xmlLoaded(event:Event):void {
                myXML = new XML(event.target.data);
                trace(myXML);
    I  got rid of that \n everywhere or move them around  and it's still the same error 1088 or 1085

  • Concat Variables from php script

    Hi everyone !
    Here is my problem,
    My php script return me something like :
    Town1='blabla'&Town2='bloublou' etc...
    I'd like to add each town (loaded by LoadVars) in a ComboBox.
    here is my script (in AS2) :
    for (i=0; i<_root.tab_result.liste_lenght; i++) {
    myCB.addItem(_root['tab_result.ville'+i],_root['tab_result.ville'+i]);
    But i don't manage to concat the first part of the variable
    name 'Town' and the value of i !
    If somebody could help me ... :D thanks a lot.
    Ps if it can help here is the result of
    _root.tab_result.toString()...
    ville30=%27VERNEUIL%2DSUR%2DSERRE%27&ville29=%27VAUCELLES%2DET%2DBEFFECO%27&ville28=%27URC EL%27&ville27=%27ROYAUCOURT%2DET%2DCHAILV%27&ville26=%27PARGNY%2DFILAIN%27&ville25=%27MONT BAVIN%27&ville24=%27MONS%2DEN%2DLAONNOIS%27&ville23=%27MONAMPTEUIL%27&ville22=%27MOLINCHAR T%27&ville21=%27MERLIEUX%2DET%2DFOUQUERO%27&ville20=%27LIERVAL%27&ville19=%27LAON%27&ville 18=%27LANISCOURT%27&ville17=%27FILAIN%27&ville16=%27ETOUVELLES%27&ville15=%27CLACY%2DET%2D THIERRET%27&ville14=%27CHIVY%2DLES%2DETOUVELLES%27&ville13=%27CHEVREGNY%27&ville12=%27CHER Y%2DLES%2DPOUILLY%27&ville11=%27CHERET%27&ville10=%27CHAVIGNON%27&ville9=%27CHAMBRY%27&vil le8=%27CHAILLEVOIS%27&ville7=%27BUCY%2DLES%2DCERNY%27&ville6=%27BRIE%27&ville5=%27BRAYE%2D EN%2DLAONNOIS%27&ville4=%27BOURGUIGNON%2DSOUS%2DMON%27&ville3=%27BARENTON%2DCEL%27&ville2= %27BARENTON%2DBUGNY%27&ville1=%27AULNOIS%2DSOUS%2DLAON%27&ville0=%27ARRANCY%27&liste%5Flen ght=31&envoi=precision&onLoad=%5Btype%20Function%5D

    Damn it i found :D
    i had to write :
    for (i=0; i<_root.tab_result.liste_lenght; i++) {
    myCB.addItem(_root.tab_result['ville'+i],_root.tab_result['ville'+i]);
    I just hope it could help someone else ahahha
    Bye ;)
    Séb.

  • Calling stored procedure from php script.

    I have the following stored procedure in Oracle 8:
    CREATE OR REPLACE procedure kunde_create
    (iname1 in varchar2,
    iname2 in varchar2,
    iname3 in varchar2,
    ianrede in number,
    istrasse in varchar2,
    iland varchar2,
    iplz in varchar2,
    iort in varchar2,
    iortsteil in varchar2,
    itelefon in varchar2,
    iemail in varchar2,
    itelefax in varchar2,
    imobil in varchar2,
    ianrufer in varchar2,
    izusinfo in varchar2,
    izusatz2 in varchar2,
    okdnr out varchar2)
    is
    vkndnr number;
    vadrnr number;
    vkdnr varchar2(15);
    ikugru constant number:=4;
    minkdnr constant varchar2(15):='44000000';
    maxkdnr constant varchar2(15):='50000000';
    begin
    ..... SOME CODE ....
    okdnr:='something_to_output';
    commit;
    end kunde_create;
    I am trying to call this SP from a php script, in this way:
    $connection = ora_logon("username@db", "password");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    $cu=ora_parse($cursor, "begin KW.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    ora_bind($cursor, ":Sta_nameD", $Sta_nameD, 32, 1);
    ora_bind($cursor, ":Sta_name2D", $Sta_name2D, 32, 1);
    ora_bind($cursor, ":ianredeD", $ianredeD, 32, 1);
    ora_bind($cursor, ":Sta_straD", $Sta_straD, 32, 1);
    ora_bind($cursor, ":Sta_landD", $Sta_landD, 32, 1);
    ora_bind($cursor, ":Sta_plzD", $Sta_plzD, 32, 1);
    ora_bind($cursor, ":Sta_ortD", $Sta_ortD, 32, 1);
    ora_bind($cursor, ":Sta_ortsteilD", $Sta_ortsteilD, 32, 1);
    ora_bind($cursor, ":Sta_telD", $Sta_telD, 32, 1);
    ora_bind($cursor, ":Sta_mailD", $Sta_mailD, 32, 1);
    ora_bind($cursor, ":Sta_faxD", $Sta_faxD, 32, 1);
    ora_bind($cursor, ":Sta_tel2D", $Sta_tel2D, 32, 1);
    ora_bind($cursor, ":Sta_anruD", $Sta_anruD, 32, 1);
    ora_bind($cursor, ":Sta_zusD", $Sta_zusD, 32, 1);
    ora_bind($cursor, ":Sta_zus2D", $Sta_zus2D, 32, 1);
    ora_bind($cursor, ":okdnr", $okdnr, 32, 2);
    ora_exec($cursor); //Line 93
    This code brings me back this error:
    Warning: Can't find variable for parameter in /www/vaillant/htdocs/www_tisweb/html/php/testdb/connect.php on line 93
    I tried nearlly everything, but it doesnt work :(
    Can anybody help me please.
    Thanx in advance,
    Ahmed Adaileh

    I had to make a few modifications to get your example to work. The
    biggest change was to the ora_bind syntax. I also found I had to
    define a variable to hold the OUT value before doing the ora_exec.
    Otherwise I got the error you saw. I'm not sure why defining it first
    is necessary. I didn't dig deeply into PHP's oracle.c code.
    My final script is below. It displays "okdnr is something_to_output".
    I tested using PHP 4.3.3 against Oracle 9.2.
    The best general suggestion I can make is to use PHP's oci8 driver
    unless you need to be compatible with existing PHP code. There is an
    example of using OUT binds in oci8 to call a stored procedure at
    PHP and serveroutput
    -- CJ
    <?php
    // Changed connection details to suit my environment
    $connection = ora_logon("scott@MYDB", "tiger");
    $cursor = ora_open($connection);
    ora_commitoff($connection);
    // Changed schema to SCOTT to match who I'd created the procedure as
    $cu=ora_parse($cursor, "begin SCOTT.kunde_create ( :Sta_nameD, :Sta_name2D, :Sta_kugruD, :ianredeD, :Sta_straD, :Sta_landD, :Sta_plzD, :Sta_ortD, :Sta_ortsteilD, :Sta_telD, :Sta_mailD, :Sta_faxD, :Sta_tel2D, :Sta_anruD, :Sta_zusD, :Sta_zus2D ,:okdnr); end;");
    // Allocated the IN parameter variables
    $Sta_nameD      = 'a';
    $Sta_name2D     = 'a';
    $ianredeD       = 1;
    $Sta_straD      = 'a';
    $Sta_landD      = 'a';
    $Sta_plzD       = 'a';
    $Sta_ortD       = 'a';
    $Sta_ortsteilD  = 'a';
    $Sta_telD       = 'a';
    $Sta_mailD      = 'a';
    $Sta_faxD       = 'a';
    $Sta_tel2D      = 'a';
    $Sta_anruD      = 'a';
    $Sta_zusD       = 'a';
    $Sta_zus2D      = 'a';
    $Sta_kugruD     = 'a';
    // Changed ora_bind syntax to match
    // http://www.php.net/manual/en/function.ora-bind.php
    ora_bind($cursor, "Sta_nameD", ":Sta_nameD", 32, 1);
    ora_bind($cursor, "Sta_name2D", ":Sta_name2D", 32, 1);
    // Change ianredeD type to 2 to match procedure definition
    ora_bind($cursor, "ianredeD", ":ianredeD", 32, 2);
    ora_bind($cursor, "Sta_straD", ":Sta_straD", 32, 1);
    ora_bind($cursor, "Sta_landD", ":Sta_landD", 32, 1);
    ora_bind($cursor, "Sta_plzD", ":Sta_plzD", 32, 1);
    ora_bind($cursor, "Sta_ortD", ":Sta_ortD", 32, 1);
    ora_bind($cursor, "Sta_ortsteilD", ":Sta_ortsteilD", 32, 1);
    ora_bind($cursor, "Sta_telD", ":Sta_telD", 32, 1);
    ora_bind($cursor, "Sta_mailD", ":Sta_mailD", 32, 1);
    ora_bind($cursor, "Sta_faxD", ":Sta_faxD", 32, 1);
    ora_bind($cursor, "Sta_tel2D", ":Sta_tel2D", 32, 1);
    ora_bind($cursor, "Sta_anruD", ":Sta_anruD", 32, 1);
    ora_bind($cursor, "Sta_zusD", ":Sta_zusD", 32, 1);
    ora_bind($cursor, "Sta_zus2D", ":Sta_zus2D", 32, 1);
    // Changed okdnr type to 1 to match procedure definition
    ora_bind($cursor, "okdnr", ":okdnr", 32, 1);
    // Bound missing parameter
    ora_bind($cursor, "Sta_kugruD", ":Sta_kugruD", 32, 1);
    // Preallocated the output variable - I'm not sure why this is
    // necessary nor what size is needed.
    // When this line is commented out I get:
    //   Warning: Can't find variable for parameter in test01.php on line XX
    $okdnr = "a";
    ora_exec($cursor);
    print "okdnr is $okdnr";
    ?>

  • Creating a array from variables passed from php

    I have passed variables from PHP to flash successfully but
    now need to firstly make them into an array. A next button and
    previous button has to trigger the step through the array.
    Any ideas?

    I have a PHP script and I get flash to load the variables
    from it. The code is as follows. Taken out the connection to DB for
    security.
    <?php
    $hostname_conn = "";
    $database_conn = "";
    $username_conn = "";
    $password_conn = "";
    // establish a SQL connection to the host - host, user, pass
    $conn = mysql_pconnect($hostname_conn, $username_conn,
    $password_conn) or trigger_error("The site database appears unable
    to provide a connection. Please contact support.
    ".mysql_error(),E_USER_ERROR); // or die("The site database appears
    unable to provide a SQL connection. Please contact support.");
    // connect to the right DB (there may be multiple db's on the
    server) dbName
    mysql_select_db($database_conn, $conn) or die("The site
    database appears to be unavailable. Please contact support.");
    $qCheck = "SELECT * FROM pics";
    $rsCheck = mysql_query($qCheck) or die("Check Failed :
    ".mysql_error());
    $cCheck = mysql_num_rows($rsCheck);?>
    &img=<?php
    while($row= mysql_fetch_assoc($rsCheck))
    print($row["img"]);
    ?>

  • Special characters in String variable sent from php.

    Hello. Assuming that I send some String variable from php into flash:
    AS3:
    var MyImportedString:String;
    var variables_page_text:URLVariables = new URLVariables();
    var varSend_page_text:URLRequest = new URLRequest("MyPHP.php");
    varSend_page_text.method = URLRequestMethod.POST;
    varSend_page_text.data = variables_page_text;
    var varLoader_page_text:URLLoader = new URLLoader;
    varLoader_page_text.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader_page_text.addEventListener(Event.COMPLETE, var_comp_page_text);
    varLoader_page_text.load(varSend_page_text);
    function var_comp_page_text(event:Event):void {
        MyImportedString =  event.target.data.MyVariable;
    php:
    <?php
    header('Content-Type: text/html; charset=utf-8');
    $MyString = "some tekst &";
    print "MyVariable=" . $MyString;
    ?>
       I've noticed that the special character '&' residing inside String, throws an error:  #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
      My first thought was, it has something to do with html entities, but other entities (like <> or ") don't throw any error. Besides, the use of php functions like htmlentities(); or html_entity_decode(); doesn't make any difference in this case:
    print "MyVariable=" . htmlentities($MyString);
    or
    print "MyVariable=" . html_entity_decode($MyString);
      I've also noticed that characters like '%', '^', '+' don't show up at all;
      What does it mean? Any ideas?
      Reagards.

    Thank You 'moccamaximum'.
    Ok. So here is the solution (php function posted by 'moccamaximum' does the trick):
    AS3:
    var MyImportedString:String;
    var variables_page_text:URLVariables = new URLVariables();
    var varSend_page_text:URLRequest = new URLRequest("MyPHP.php");
    varSend_page_text.method = URLRequestMethod.POST;
    varSend_page_text.data = variables_page_text;
    var varLoader_page_text:URLLoader = new URLLoader;
    varLoader_page_text.dataFormat = URLLoaderDataFormat.VARIABLES;
    varLoader_page_text.addEventListener(Event.COMPLETE, var_comp_page_text);
    varLoader_page_text.load(varSend_page_text);
    function var_comp_page_text(event:Event):void {
        MyImportedString =  event.target.data.MyVariable;
         trace(MyImportedString);        // Output:  some text &%^+
    php:
    <?php
    header('Content-Type: text/html; charset=utf-8');
    $MyString = "some text &%^+";
    print "MyVariable=" . flash_encode($MyString);
    function flash_encode($string){
         $string = rawurlencode(utf8_encode($string));
         $string = str_replace("%C2%96", "-", $string);
         $string = str_replace("%C2%91", "%27", $string);
         $string = str_replace("%C2%92", "%27", $string);
         $string = str_replace("%C2%82", "%27", $string);
         $string = str_replace("%C2%93", "%22", $string);
         $string = str_replace("%C2%94", "%22", $string);
         $string = str_replace("%C2%84", "%22", $string);
         $string = str_replace("%C2%8B", "%C2%AB", $string);
         $string = str_replace("%C2%9B", "%C2%BB", $string);
         return $string;
    ?>

  • Accessing passed arguments from php script?

    I have a php script which will pass an argument which I need
    to turn in to a coldfusion variable, how should I go about doing
    this?

    I am developing a cf application to interface with the PLESK
    control panel's Event manager to dynamically setup cf security
    sandboxes when a new domain is added to PLESK. Plesk uses encrypted
    php3 files and with the use of the event manager API I can pass the
    new domain name to any script. However, I cannot alter the way
    PLESK sends the param <new domain> therefore a cfhttp post is
    impossible. All I can do is path the new domain as an argument to
    the file IE: myscript.cfm.
    I have tested passing the new domain to a bash shell script
    and then using bash to drop the new domain name into a database
    then using CURL to execute the .cfm file which sets up the new
    sandbox. This is tested and working on Linux servers but now my
    task is to do the same for Windows servers, hence I would prefer to
    keep all the coding under cf

  • Sending variable value from php to flash to load an xml file

    I would like to load an XML file from the location locally or on the server being unaware of the name of the file. I am using PHP for sending the filename to Flash.
    The below is the PHP code:
    <?php
    filesInDir('C:\Documents and Settings\457305\My Documents\shrikant\Flash Tutorials\webassist');
    function filesInDir($tdir)
            $dirs = scandir($tdir);
            foreach($dirs as $file)
                    if (($file == '.')||($file == '..'))
                    elseif (is_dir($tdir.'/'.$file))
                            filesInDir($tdir.'/'.$file);
                    else
                            echo "fileName=$file";
    ?>
    And below is the loading Actionscript code:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.net.URLVariables;
    stop();
    // Define the PHP file to be loaded
    var phpFile:String = "http://localhost/webassist/test.php";
    var cons_xml:XML;
    var xmlLoader:URLLoader = new URLLoader();
    // Specify dataFormat property of the URLLoader to be "VARIABLES"
    // This ensures variables loaded into Flash with same variable names
    xmlLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    xmlLoader.load(new URLRequest(phpFile));
    xmlLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(evt:Event):void
              trace(evt.target.data.fileName);
              //cons_xml = new XML(evt.target.data.fileName);
              //gotoAndPlay(2);
    When I trace the evt.target.data it displays "fileName=mainOpenEndedXML%2Exml" and when I trace evt.target.data.fileName the fileName is properly displayed as "mainOpenEndedXML.xml".
    But in the next two lines where the loading occurs it does not load the file i.e the swf file from xml doesn't play.
    I have been searching the Internet for answers but not able to find any solutions.
    The loading works properly if i directly insert the xml file in the code and the swf's in the XML file play propertly. The below is the code for the same:
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.net.URLVariables;
    stop();
    var cons_xml:XML;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("mainOpenEndedXML.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(evt:Event):void
              cons_xml = new XML(evt.target.data);
              gotoAndPlay(2);
    Any help on this would be greatly appreciated

    Yes. you already said that, but I guess you don't understand what I said.  You are loading the PHP fle to get the filename, but nowhere are you taking that filename and loading the file that was named. 
    You need to do two loading operations.  The first one to get the filename, and the second to load the file with that name.  Maybe if you name the PHP file loader phpLoader instead of xmlLoader it will start to make more sense to you.  Something like the following...
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.net.URLVariables;
    stop();
    // Define the PHP file to be loaded
    var phpFile:String = "http://localhost/webassist/test.php";
    var phpLoader:URLLoader = new URLLoader();
    // Specify dataFormat property of the URLLoader to be "VARIABLES"
    // This ensures variables loaded into Flash with same variable names
    phpLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    phpLoader.load(new URLRequest(phpFile));
    phpLoader.addEventListener(Event.COMPLETE, processPHP);
    function processPHP(evt:Event):void
             var xmlLoader:URLLoader = new URLLoader();
             xmlLoader.load(new URLRequest(String(evt.target.data.fileName)));
             xmlLoader.addEventListener(Event.COMPLETE, processXML);
    var cons_xml:XML;
    function processXML(evt:Event):void
              cons_xml = new XML(evt.target.data);
              gotoAndPlay(2);

  • AS3 send/import variables to/from php file

    Hi
    im new I would like to send some variables from ac3 to a
    php-file. the
    php-file have to copperate with this variable (send
    querystring to
    mysql-server).
    ac3 have to read then new variables and traced it on the
    screen.
    i found some examples on the net but i have not undersood
    any.
    can you please explane that to me????
    Sebastian

    Hi
    im new I would like to send some variables from ac3 to a
    php-file. the
    php-file have to copperate with this variable (send
    querystring to
    mysql-server).
    ac3 have to read then new variables and traced it on the
    screen.
    i found some examples on the net but i have not undersood
    any.
    can you please explane that to me????
    Sebastian

  • How to send 2 variable value from bash script into java.class

    #!/bin/bash
      a=10
      b=20
       echo $a $b | java addition
    donehi there,
    currently i have a simple java coding ( a + b ). and i m trying to connect with bash script but this bash script coudln't Enter 2nd value (b=20) while i running for it. may i know how do i can Enter 2 value into it?
    output from terminal
    [seng@localhost java_class]$ bash addition.sh
    =======================================================================
    simulation 1
    Num_a       = 10
    Num_b       = 20
    Enter your Num_a : 10
    Enter your Num_b : Exception in thread "main" java.lang.NumberFormatException
       at java.lang.Integer.parseInt(java.lang.String, int, boolean) (/usr/lib/libgcj.so.6.0.0)
       at java.lang.Integer.parseInt(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
       at filter_god.GOD(java.util.List, java.util.List, java.lang.String, java.lang.String, int) (Unknown Source)
       at filter_god.main(java.lang.String[]) (Unknown Source)
       at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
       at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
    =======================================================================

    That code will send both numbers on a single line in standard input to the java process. So if the process reads standard input, it will get a single line that has this in it: "10 20".
    I'm guessing you're sending that whole line to Integer.parseInt. But a valid number doesn't have a space in the middle.
    You should split up the line using String.split. Or use a StringTokenizer. Or a regular expression. Or you can use a java.util.Scanner. Or a java.io.StreamTokenizer. Or maybe some other stuff that has slipped my mind at the moment.

  • How to fill my collapsible panels with dynamic content from PHP scripts?

    Hi people,
    I'm trying to generate dynamically generated content in a
    Spry collapsible panel. Previously I've generated PHP files that as
    an output generates a dynamic table with the data I want to show. I
    figured it would be possible to use an php include option to
    generate this table in a content section of a Spry collapsible
    panel. However, when I do this the collapsible panels appear to
    join and when panel1 is clicked all tables close instead of only
    panel 1 and all tables are put benath each other without putting it
    in each seperate panel. But when i replace the file with only the
    text "content" it works fine. Do i maybe have to add some kind of
    command at the end of my php file to make it look like the
    "content"-text or is this not the problem?
    I've been looking for the answer now for a couple of weeks on
    various forums and nothing seemed to work for me. Can please
    somebody help me out?
    Greets,
    Damian
    The code in its non working form:
    <head>
    <!--Link the CSS style sheet that styles the Collapsible
    Panel-->
    <link href="SpryAssets/SpryCollapsiblePanel.css"
    rel="stylesheet"
    type="text/css" />
    <!--Link the Spry Collapsible Panel JavaScript
    library-->
    <script src="SpryAssets/SpryCollapsiblePanel.js"
    type="text/javascript"></script>
    </head>
    <body>
    <!--Create the Collapsible Panel widget and assign
    classes to each element-->
    <div id="CollapsiblePanel1" class="CollapsiblePanel1">
    <div class="CollapsiblePanelTab">Tab</div>
    <div class="CollapsiblePanelContent"><?php
    include('details_books.php');?></div>
    </div>
    <div id="CollapsiblePanel2" class="CollapsiblePanel2">
    <div class="CollapsiblePanelTab">Tab</div>
    <div class="CollapsiblePanelContent"><?php
    include('details_authors.php');?></div>
    </div>
    <!--Initialize the Collapsible Panel widget object-->
    <script type="text/javascript">
    var CollapsiblePanel1 = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
    </script>
    <script type="text/javascript">
    var CollapsiblePanel2 = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel2");
    </script>
    </body>

    you need to save the page as a php page (.php) It works
    fine

  • Passing variables from PHP to AS3

    I am trying to get variables retrieved from a MySQL database
    by a PHP script into my ActionScript 3.0. script. To test I have
    created a simple instance of dynamic text called date_txt, and put
    the AS3 code below into the actions layer:
    All I want to do now is replace the hardcoded date values
    with variables passed from the PHP script (also shown below).
    Can anyone suggest a VERY simple way of passing the PHP
    variables $tgt_year, $tgt_month and $tgt_day into the AS3 code and
    let me know what modifications I need to make to the PHP to make
    the variables available to Flash?
    Thanks, Will

    Hi dzedward,
    I tried the code you posted at
    http://forums.flashgods.org/viewtopic.php?f=41&t=98
    with a little problem. Why is it that the value from event.data
    after complete loading has the value of the entire script of PHP
    script?
    At first, I have this error:
    The markup in the document following the root element must be
    well-formed.
    I replace the following codes: ########
    XML.ignoreWhitespace = true;
    var theResult:XML = new XML(event.target.data);
    var lastName = theResult.client.lname;
    With this one: ########
    trace(event.target.data);
    and has this output: #########
    <?Php
    echo "<?xml version=\"1.0\"?><clients>";
    echo "<client><lname>test
    sdfsaf</lname></client>"
    echo "</clients>";
    ?>
    instead of this output: #########
    <client><lname>test
    sdfsaf</lname></client>
    Please help me out.
    Thank you

  • URLLoader with variables to php script

    looking for an example of coding URLLoader / URLRequest with POST variables to a php script and back. Can this be adequately tested using WAMP locally?

    var urlloader:URLLoader=new URLLoader();
    var urlR:URLRequest=new URLRequest("yourphpscript.php");
    var urlVar:URLVariables=new URLVariables();
    urlVar.var1="whatever";
    urlR.data=urlVar;
    urlR.method = URLRequestMethod.POST;
    urlloader.dataFormat = URLLoaderDataFormat.TEXT;
    urlloader.addEventListener(Event.COMPLETE, completeF);
    urlloader.load(urlR);
    function completeF(e:Event):void {
    trace(urlloader.data);

  • Flex application works locally, fails when online (connecting to PHP script to insert row into DB)

    Hi everyone,
    I've got a Flex application that works wonderfully when I test it on my machine locally. It uploads files and send variables to a PHP script (that inserts them into a DB) with no errors when I run it locally. As soon as I put it online, the upload continues to work but something between my Flex application and the PHP script fails because no data is committed to the DB. I know the PHP script works fine - not only does it work when I run the Flex application locally but when I go directly to the PHP file online, a new empty line is added to the DB.
    I initially thought that this was a cross domain issue so I added the following to the root of my hosted account:
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*.MYURL"/>
    <allow-http-request-headers-from domain="*.MYURL" headers="*" secure="false"/>
    </cross-domain-policy>
    I based this off of what I found online which seems to have done nothing for me. I'd also be happy to provide an error message but I don't get one when I debug.
    Any thoughts would be greatly appreciated.

    Use a network monitor to see if the Flex app is truly requesting the right URL.
    -Alex

Maybe you are looking for

  • My macbook pro is running slow, what do I do?

    My macbook Pro is running very slow when loading new tabs on the internet. I am operating Mac OS X 10.7.5, memory is 4GB and processor is 2.3 GHz Core i5, apparetnly I have a possible 180GB out of 319GB Is there something I can do to clean-up or get

  • RecordSet Structure Sequence Variable in JMS like in File Adapter

    Hi all, We are having some problems trying to find how to implement the functionality of the variable recordset structure in a JMS adapter. We do have a structure with this form: HR - data AR - data AR - data HR - data The two first chars are the key

  • [Solved] cups was installed, but no cupsd until I reinstalled it

    Maybe I am completely missing something, I probably am. But I tried to start cupsd and there was no script for it on my system. pacman -Qis showed that the most recent cups package (1.5.3.5) was installed. I was scratching my head for a good while. I

  • HT201335 Can you Airplay mirror via your laptop?

    I figured out how to mirror via my iPhone, but cannot figure out (if at all possible) how to mirror my laptop.

  • Control totals

    Dear SAP Experts, Is is possible to send email to bank with control total amounts with (or seperate) our EDI 820 file of payment run. How can we make it possible, will it be manual or automatic procedure. Please advise, Thanks & Regards, Paul