URLRequest data from PHP bad data

PHP is very basic:
<?php
echo "tcount=10";
?>
Following the tutorials, I'm able to connect to the PHP with URLRequest, but there seems to be some problem with the returned data.
var myLoader:URLLoader = new URLLoader();
myLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
myLoader.load(new URLRequest("http://localhost/myphp.php"));
myLoader.addEventListener(Event.COMPLETE, onDataLoad);
private function onDataLoad(evt:Event):void {
trace( evt.target.data.tcount );
output returns undefined
I'm pretty sure the URLRequest is connecting ok. I'm able to navigate to the page and see the content in the browser.
Also the following displays something:
trace( evt.target.data );
Output:
%0D%0Atcount=10
I've tried different URLLoaderDataFormat types, decoding via URLVariables, and everything else I can think of.
Where's that front-end garbage come from, and how do I get rid of it?
Maybe some PHP setting I have wrong?

That worked; thanks, although it's a mystery to me why it would matter how
the echo string is constructed.
While I have your attention, I'm finding that changing the value in the php
file isn't being reflected when I use Ctrl-Enter to test the Movie from the
Flash builder.
I changed to:
<?php
$tCount=89;
echo "tCount=".$tCount;
?>
Running "Test Movie" from Flash builder still shows 10,
But if I publish an HTML file and test in the browser, I get the right
number displayed.
I can live with this, but if you know of some adjustment to make to have the
PHP file change reflected in test, I'd appreciate the advice.
Thanks agin.

Similar Messages

  • Exporting Text data from PHP to Oracle CLOB data (Carriage return - issue)

    This is my original text content in PHP - Data type - Longtext
    SECTION - 1
    This a test description.This a test description.
    This a test description.This a test description.
    This a test description. This a test description.I exported the above content from PHP as a SQL script file (insert into.. ) - export.sql [ insert into table_name (id, text_content) values (1, '') ]
    while exporting data from PHP table into export file.. it replaced the "Carriage return" with "\r\n\r\n" in the insert statement for text_content column
    When I run this INSERT statement in Oracle (for longtext, I have created a CLOB column in Oracle), the following text_content data is inserted into CLOB column in Oracle.
    SECTION - 2
    This a test description.This a test description.\r\n\r\nThis a test description.This a
    test description.\r\n\r\nThis a test description.This a test description.Now I have created a item named P1_TEXT_CONTENT of type TEXTAREA and try to fetch the CLOB data into this page item.
    BUT textarea displays the entire content including "\r\n\r\n" as mentioned in SECTION - 2
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?
    Thanks,
    Deepak

    DeepakJ wrote:
    I want to display the content in textarea (item - P1_TEXT_CONTENT) without "\r\n\r\n" same as the original content with "Carriage return" as mentioned in SECTION - 1
    What are the options we have?Run an update on the Oracle table following the inserts to replace the escaped CR/LFs with real ones:
    update foo
    set clob_column = replace(clob_column, '\r\n', chr(13) || chr(10));You might want to experiment to see which characters are actually necessary. As an OS X/Linux user I'd probably just use a single LF chr(10).

  • How to get data from php to java via xmlrpc

    I have been trying to get data from php through apache xmlrpc to java.
    I do get an value as result. The result is "Array". How how do i convert the XMLRPC Object "Array" to Java Object?
    Inside the XMLRPC "Array" Object there is object too of type Array from php.
    See code for java here
    Object result = client.execute( "blogger.getCategories", params1 );
    Code from php here
    function getCategories($appkey, $username, $password)
         global $xmlrpcerruser, $xmlrpcI4, $xmlrpcInt, $xmlrpcBoolean, $xmlrpcDouble, $xmlrpcString, $xmlrpcDateTime, $xmlrpcBase64, $xmlrpcArray, $xmlrpcStruct, $xmlrpcValue;
         $structArray = array();
         $structArray[] = new xmlrpcval(array("one" => "test"));
         return new xmlrpcresp(new xmlrpcval( $structArray , $xmlrpcArray));     
    I do get Standard String and Integer from php to Java through XMLRPC.
    Can someone help me.
    Edited by: Electron32 on Aug 13, 2010 9:44 AM

    That is what is so strange. I return an 'array' through xmlrpcval() and in Java I tried to cast it to ArrayList, Vector,String[] but get an error
    Object[] result = (Object[]) client.execute( "blogger.getCategories", params1 );
    String[] array = (String[]) result;
    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
            at com.dirdalit.window.Main.main(Main.java:41)
    Edited by: Electron32 on Aug 13, 2010 12:25 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Updating data from PSA to Data Target

    Hi,
    I just want to update data from PSA to data target.
    There is a process chain running daily it will updating Master Data in to 0Vendor object. This process chain is updating only upto PSA not the data target. I just want to update from PSA to data target.
    There is a update rule for 0Vendor but itu2019s not active at the movement and also it is not properly mapped with the 0Vendor.
    Is there any other method which I can update data from PSA to Data target with in the same process chain.
    Thanks
    Ganesh

    If this is BW 3.5, change the infopackage setting to load to data target as well.
    This is a other w ay than using the update from infopackage.
    if this is 7.0, Use the DTP to load from PSA(datasource) to Target.
    Let me know if this helps.
    Thanks
    Sachin

  • Error in Source System While Uploading Data from ODS to Data Target

    Hi All,
    Iam getting Following Error while Uploading data from ODS to Data Target
    a) Error in Source System.
    b)DataSource 80MKT_DS01 has to be replicated (time stamp, see long text)
    Message no. R3016
    Diagnosis
    DataSource 80MKT_DS01 does not have the status of the source system in the Business Information Warehouse.
    The time stamp in the source system is 21.06.2005 07:31:33.
    The time stamp in the BW system is 27.11.2004 17:41:45.
    Regards,
    Chakri

    This generally occurs when you change the data source or enhance the data source or the coonections to the datasoiurse are broken. To resdolve thius sort of errors just
    1. Check for the coonect between the sourse & target systems
    2 . Replicate the data sourcses.
    3. Acivated TR,UR,& the rest of the flow But check in the source system if the structre is modified & is so do the changes in the IS , TR,UR correspondingly & the try to load .Hoppe it allows you to load .
    Thanks ,
    PSG

  • Adobe offline form with capablity to read data from a local data base.

    Hi ,
            We have customer requirement for a offline Adobe form which will be used by Sales rep, this form when saved to the local hard disk is required to read data from another local data base available in the laptop  and prefill a few fields in the form . 
    Is this requirement technically feasible using Adobe forms?
    Thanks
    Srikanth S

    Well may be it's possible because if you go to the Data View in ALD and create a new Data Connection --> OLEDB database --> Build --> It gives you various options for connecting to different DBs but frankly speaking I have never tried it.
    Check the ALD help for more information on the topic.
    Using LiveCycle Designer > Working with Data Sources > Connecting to a data source > To create a data connection to an OLE database
    Chintan

  • Weblogs: Cycle Count Inventory Date: From IM inventory date to WM inventory

    Dear All,
    I have updated new weblog on the common problem for physical inventory.
    When any organization plans to go for implementing the warehouse management; it has major concern about the physical inventory process, particularly last physical inventory date.
    More details are available on this weblogs:
    /people/community.user/blog/2007/10/04/cycle-count-inventory-date-from-im-inventory-date-to-wm-inventory-date
    <b>Your feedback/comments are most welcome, <u>Please write on the weblog page, not in this thread.</u></b>
    Regards
    Arif Mansuri

    Dear All,
    Here is my previous weblog, Your comments will work as tonic for me ), so leave your comment on both of these blogs.
    /people/community.user/blog/2007/05/04/physical-inventory-in-material-management
    Enjoy SAP..
    Regads
    Arif Mansuri

  • Determine previous date from the selection date

    Hi Guys,
    I need to get a previous date from the selection date mm/dd/yyyy
    Eg:
    Selection date is 02/28/2008
    Sol- -02/27/2008
    Selection date - 03/01/2008
    Sol- 02/29/2008
    Selection date - 04/02/2008
    Sol-04/01/2008
    If i do ofset -1 in query ....it goes -1 month. In Exit if i do Sys-datnum -1. It works but not in case for Feburary month. Since 2008 year has Feb (29 days) but for 2007 (28 days)
    Regards

    Hi,
    Problem is i have a 0Date restricted to a variable and if i do offset-1 to that variable it goes previous month not the date.
    I dont have 0CALDAY in my cube. Can i do in the UserExit.
    If i do sy-datum-1. Will it work?
    Because the FEb one is the main problem
    Regards

  • Extracting data from ms sql data base

    Hi Experts,
    we have a requirement of extracting data from MS SQL data base,could any one pls help me with the approach to extract data
    from ms sql data base(actually we have to extract the data from PRIMAVERA i.e the back end data base is MS SQL data base and the application is built on java)so we have got two options one is using ud connect and the other one is using PI(XI).i came to know the two approach have based on differenct methods,pull and push mechanism.and also for PI,it can be extracted using
    real time data acquisition property in dtp and for db connect it don't support real time data acqusition.
    so pls guide me,which mechanism would be feasible to extract the data from PRIMAVERA to SAP BI.and can you suggest with methods is more efficient.
    Thanks in advance.

    Hi thanks for the reply,
    initially we tried with db connect,but our Bi system(oracle) is mount on unix OS and the Primavera(MS Sql DB)is on windows OS.so we could not found the data base shared library  once if the DB client is installed on the application server.so we are working around with the other possibilities,so can you suggest me which could be favarable in our case.
    Thank You.

  • Send data from PHP - Flash - PHP

    Hi,
    I have some issue with passing data from Flash to PHP and
    reciprocally.
    when i browse the FlashDataExchange.php file (which includes
    the flash)
    it does not redirect automatically to the 2nd PHP page...
    And i do not get any data on the 2nd PHP page....
    i'm lost, what do i do wrong ?
    thanks for your help.
    Alain
    i have the following AS3 code :
    import flash.external.*;
    myButton.addEventListener("click", sendData2PHP);
    //var link2:String = "
    http://192.160.1.2/test/flashdataexchange.php";
    var link:String = "
    http://192.160.1.2/test/DataExchangeResult.php";
    var request:URLRequest = new URLRequest (link);
    var loader:URLLoader = new URLLoader (request);
    var variables:URLVariables = new URLVariables();
    request.method = URLRequestMethod.POST;
    request.data = variables;
    var curUrl:String = String( ExternalInterface.call("
    function(){ return
    document.location.href.toString();}"));
    function sendData2PHP(evt:Event):void
    variables.lg = myField1.text;
    variables.address = myField2.text;
    variables.field2 = curUrl;
    loader.addEventListener(Event.COMPLETE, onComplete);
    loader.addEventListener(IOErrorEvent.IO_ERROR, sendIOError
    loader.dataFormat = URLLoaderDataFormat.TEXT;
    loader.load(request);
    function onComplete (event:Event):void
    Text1.text = event.target.data;
    My DataExchangeResult.php file looks like that:
    <html>
    <head>
    </head>
    <body>
    <?php
    $lg=$_POST['lg'];
    $ad=$_POST['address'];
    $f2=$_POST['field2'];
    echo "test : ".$ad ;
    ?>
    </body>
    </html>
    and my FlashDataExchange.php file is the following one:
    <html>
    <head>
    </head>
    <body>
    <?php
    echo "-- POST -- <br>";
    echo "Lg : ".$_POST['l']."<br>";
    echo "Address : ".$_POST['address']."<br>";
    echo "f2 : ".$_POST['f2']."<br>";
    echo "<br>-- GET -- <br>";
    echo "Lg : ".$_GET['l']."<br>";
    echo "Address : ".$_GET['address']."<br>";
    echo "f2 : ".$_GET['f2']."<br>";
    ?>
    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
    width="400" height="200" id="FlashdataExchange"
    align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="FlashdataExchange.swf"
    /><param
    name="quality" value="high" /><param name="bgcolor"
    value="#006600" />
    <embed src="FlashdataExchange.swf" quality="high"
    bgcolor="#006600"
    width="400" height="200" name="FlashdataExchange"
    align="middle"
    allowScriptAccess="sameDomain" allowFullScreen="false"
    type="application/x-shockwave-flash"
    pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    />
    </object>
    </body>
    </html>

    &gt; it does not redirect automatically to the 2nd PHP
    page...
    URLLoader does not ever change the page location, it only
    loads data from the URL. To change pages, you need to use
    navigateToURL(), which can also send POST/GET variables along with
    the URL request.
    &gt; And i do not get any data on the 2nd PHP page....
    A quick look at your code looks correct to me: you are
    listening for the complete event, dataFormat is text, and PHP is
    echoing. However, check for httpStatus event and see if it gives
    you anything interesting... I can't get to the link myself, aka
    404. Also check the securityError event.

  • How to Save data from HR_INDVAL BADI

    hI
    I M USING THE ABOVE BADI FOR CALCULATION OF BONOUS FOR INFOTYPE 15  .... IT IS CALCULATING VERY WEL BUT DATA IS NOT GETTING SAVE IN PA0015 .
    KINDLY HELP ME
    REGARDS
    AMMAD

    hi
    i have created UDO i have also done registration  i want to bind item master completely to matrix and then in one column i will set check box to check unchecked and then i want to save it to database
    i have one user defined form and 4 matrix and 4 child tables
    for each matrix i have given 1 form and i have to transfer the data from temp form to main form matrix having large data in matrix on temp form to main form matrix
    to load data on matrix i have used for loop that i want to avoid so how i can bind large data to matrix without for loop
    regards
    amey

  • How to retrieve data from php to a java applet?

    hi! wer having this project on printing jar files and reports..where these reports are generated from php. data will be passed as objects to the java applet. how r we suppose to do this? can someone pls explain it to me further and clearly? many thanx.. :) God bless!

    What? Is the php page going to send Java objects?

  • Fetching data from PHP

    i am trying to fetch thousands of row from mysql though php.......
    so is there any simple and fast method........i know other simple methods POST...but is there any other method which is faster??

    Fot large amounts of data you could look into AMFPHP.
    Lee Brimelow has three videos about it at http://www.gotoandlearn.com/
    Two introductionary and one with the Zend framework.
    AMFPHP is about sending binary data instead of ASCII data which XML would be. So there's less data to send and I think binary data also faster to parse than XML with E4X. See: http://www.jamesward.com/blog/2007/04/30/ajax-and-flex-data-loading-benchmarks/ for more about the speed benefits

  • How to backup data from a bad partition?

    Hi,
    My HDD in my Macbook Pro crashed due to a frequent uncontrollable on and off, I tried to boot into recovery mode but it won't let me mount the drive so that I can't repair permission, and I also fail to repair the disk neither not even target disk mode to another mac. So I assume my HDD is totally screwed for now, so are there any way to backup any data from this screwed HDD?
    Thank you so very much!
    Jeffero.    

    You can always try - but there's no guarantee of success.
    Which model (e.g., "15" late 2011") MacBook Pro do you have? Need that info...
    The first thing that you'll need to do, of course, is buy a new hard drive and install it. Decide on what speed (5400rpm or 7200rpm) you want and then how much space you need.
    The second thing is to buy an enclosure for your 'old' HD - I have a number of these from OWC.
    The third thing - formatting and installing a working OS on your new hard drive will depend on which model MacBook Pro you have.
    Fourth thing - to try to recover data yourself, you're just going to have to pony up $100 and purchase DiskWarrior: now I've never used it - I have tested Data Rescue 3 on undamaged drives with great success -  but I think that in your case DiskWarrior would be the better product. Don't be surprised if it doesn't work - it just offers you the 'best chance' to rescue data.
    Once you have your new hard drive installed and bootable, connect your old drive (now in an enclosure) and use DiskWarrior to try rescuing some data. As I said, there's no guarantee here but it's the first thing to try before spending $1000 or so at a data rescue specialist.
    Good luck,
    Clinton

  • Invisible enters output=" %0D%0A%"  while reading data from php

    Hello, i made a php file and returns this output: hello=ok in
    the internet explorer.
    But in flash it outputs hello=ok%0D%0A%
    If you look in the source of the internet browser you can see
    that there are invisible enters after the output text.
    It seems flash converts this into code? But i can't seem to
    find any enters in my php file.
    Is there a way to get rid of this %0D%0A% code?
    The way i traced the output is:
    function dataOnLoad(evt:Event){
    trace(evt.target.data);
    if(evt.target.data.hello=="ok") {
    gotoAndStop(2)
    } else message_txt.text = Error??"

    Hi
    This is a result of whitespace in your php script, delete all
    linefeeds, tabs, make sure every line is one a complete line and
    not split over several. Whitespace in a browser is ignored but
    Flash will see it and it can be a real pain to get rid of it.
    Hope it helps

Maybe you are looking for