Flex vs php

hey everybody
i am biginnner with flex developpement but i have enough knowledg in dynamic web developpement ( with dreamweaver).
i want to know the equivelence between developping in php and flex.
i mean in php we are used to work with pages, links, passing parameters.
is it the same thing (architecture) in flex ? or flex has its own architecture to work with multiple pages and relatring them with links and parameters.
thx for the help

hey...
i found the answer here :
http://www.adobe.com/mena_fr/devnet/flex/testdrive.html
thnx for viewing

Similar Messages

  • How to get Checkbox Value from Flex in PHP.

    Hi,
    I need to know how to get a checkbox value from flex in PHP-POST/GET because I don't know what is the value property of a checkbox in flex.
    Please Help.

    Hi,
    It is very simple. Follow the steps below to achieve the solution,
    1. Write a check-box change event to capture the value of the check box. Store this value in a variable(say bolChkSelected:Boolean).
    2. In step 1 you got the value of the check box. Now your aim is to send the value to php. Declare a httpService in your flex application(i think you are aware of using it).Ok..im writing it
    <mx:HTTPService id="sampleService" resultFormat='e4x' url='http://yourdomain/file.php' result='handleResult()' fault='handleFault()'>
    </mx:HTTPService>
    3. Now the actual solution... u need to send the shcStatus in to php..
    Declare an object to hold the data
    var objparameters:Object={};
    objparameters['CheckBoxdata'] = bolChkSelected;
    --in the above line... 'CheckBoxdata' is used as a parameter to php..you shud have the same variable name while accessing in php file also..
    in php file..
    checkboxstatus = $_POST[''CheckBoxdata''];
    echo checkboxstatus
    thats it..

  • Completely different AMF request packets for same remote service call from Flex to PHP using ZendAMF

    I was trying to debug why one of the remote-services in our Flex application was failing randomly. What I found was interesting. Completely different AMF request packets were sent for same remote service call from Flex to PHP.
    When the service call succeeds the AMF request packet looks like the following:
    POST /video/flex/bin-debug/gateway.php HTTP/1.1
    Host: localhost
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Cookie: PHPSESSID=j6u30i8uu6c3cvp8f4kipcpf05
    Referer: http://localhost/video/flex/bin-debug/main.swf/[[DYNAMIC]]/5
    Content-type: application/x-amf
    C    ontent-length: 305
    Flex Message (flex.messaging.messages.RemotingMessage)     operation = getMemberFromEvent    clientId = 2F997CD0-7D08-8D09-1A9B-0000422676C8    destination = MembereventService    messageId = B46AB58D-2241-83F0-41E4-9FE745565492    timestamp = 0    timeToLive = 0    body =     [      280    ]    hdr(DSId) = nil
    And when the service fails the AMF request packet looks like this:
    ServiceRequest: getMemberFromEvent; RemoteService; getMemberFromEvent
    (mx.messaging.messages::RemotingMessage)#0
      body = (Array)#1
        [0] 250
      clientId = "1AA4FAAB-AEA5-8109-4B0D-000002B3A9A1"
      destination = "MembereventService"
      headers = (Object)#2
        DSEndpoint = (null)
        DSId = "nil"
      messageId = "2F92E6C0-FE92-A09B-B150-9FE2F28D9738"
      operation = "getMemberFromEvent"
      source = "MembereventService"
      timestamp = 0
      timeToLive = 0
    Also, following is the error message on Flex when the service fails:
    {Fault code=Channel.Call.Failed, Fault string=error, Fault detail=NetConnection.Call.Failed: HTTP: Failed, Destination=MembereventService}
    We are using Swiz as the micro-architecture for Flex development and Zend AMF for remoting between Flex and PHP.
    Any ideas what is wrong here, what is causing Flex to send different request packets for the same service & what I can do to fix it?

    Hi, I know that your post is almost 5 years ago, but have you found the solution to this issue?
    Thanks.

  • Flex and php file uploader cross browser problems

    Hi, I have a problem in flex and php file uploader. It was
    working fine in Internet Explorer, but nothing would work in
    Firefox and in other browsers. Firefox and other browsers was not
    sending the session with the file upload and was producing a login
    error. On IE the session cookie is picked up and the upload request
    uses the authenticated session, no login error. I'm newbie in flex.
    Please help me. Thanks in advance!
    Here's my code:
    bgupload.mxml

    Hello, I am Gamaliel Arredondo, i have solved this problem, the error is in the code, you have a mistake in your code, check it out.
    The way to run the flex applications, in my case, i installed xampp, in the htdoc directory i put the folder with the files of the application and all is working very well, only when the apache is running because if it is stoped the application show error, please review your code and if you have problems you can contact me by e-mail ([email protected]) i also fought with that problem but i could find the solution, i hope to help you.

  • Flex with php air application

    Hi ,
    I am new in flex.
    Actually i make a flex with php desktop application. There are two problems which i am not getting:
    a.) I make three module which i load on tab navigator click . These mudules working fine . But when i make this project export relese build to make .exe file . These modules not added in installation file.
    i.e after installation i have to copy these modules .swf file in program files where the application installed. So i want to know is there is any method so that module added in the .exe file so that they by default goes at the
    time of installation of exe.
    b.) I use php services in this project and when i insatlled the application to system its not working untill i add the the project service php file and zend frame work folder on user wamp . Is there any method that all these happen by default at the time of insatllation.

    Hi,
    AIR is best suited to be a client application.
    P.S: Since you are using PHP, you may want to take a look at
    amfphp so that you can use AMF to speed up data transfer between
    your AIR app and the PHP server.

  • Flex Mobile - Php INSERT

    Hello everybody, im a novice on Developpement using Flex.
    im working on a project which will be runned on BlackBerry Tablet (PlayBook), im using FlashBuilder Burrito + AIR SDK
    my project is a CRUD application, so i follow this tutorial http://www.adobe.com/devnet/flex/testdrivemobile/articles/mtd_1_1.html and it works
    now i try to do the same things on my DataBase, i can retrieve data but i can't Insert or Delete ...
    this is the code of my application :
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark"
              xmlns:mx="library://ns.adobe.com/flex/mx"
              xmlns:valueObjects="valueObjects.*"
              xmlns:affiliesservice="services.affiliesservice.*"
              title="Accueil">
         <fx:Script>
              <![CDATA[
                   import mx.rpc.events.ResultEvent;
                   protected function saveBtn_clickHandler(event:MouseEvent):void
                        aff.longitude=11111.1;
                        aff.lattitude=11111.3;
                        createAffilies(aff);
                   protected function createAffilies(item:Affilies):void
                        createAffiliesResult.token = affiliesService.createAffilies(item);
                   protected function createAffiliesResult_resultHandler(event:ResultEvent):void
                        navigator.popView();
                        navigator.pushView(ajoutValides);
              ]]>
         </fx:Script>
         <fx:Declarations>
              <valueObjects:Affilies id="aff" />
              <s:CallResponder id="createAffiliesResult" result="createAffiliesResult_resultHandler(event)"/>
              <affiliesservice:AffiliesService id="affiliesService"/>
         </fx:Declarations>
         <s:Scroller left="0" right="0" top="0" bottom="103">
              <s:VGroup x="38" y="110" width="100%" height="100%" gap="15" paddingBottom="15"
                          paddingLeft="15" paddingRight="15" paddingTop="15">
                   <s:Label text="Nom"/>
                   <s:TextInput width="100%" text="@{aff.nom}"/>
                   <mx:Spacer height="5"/>
                   <s:Label text="Adresse"/>
                   <s:TextInput width="100%" text="@{aff.adr}"/>
                   <mx:Spacer height="5"/>
                   <s:Label text="Telephone"/>
                   <s:TextInput width="100%" text="@{aff.tel}"/>
                   <mx:Spacer height="5"/>
                   <s:Label text="Url"/>
                   <s:TextInput width="100%" text="@{aff.lien}"/>
                   <mx:Spacer height="5"/>
              </s:VGroup>
         </s:Scroller>
         <s:Button id="saveBtn" left="10" bottom="10" width="45%" label="Save"
                     click="saveBtn_clickHandler(event)"/>
         <s:Button id="cancelBtn" right="17" bottom="10" width="45%" label="Cancel"/>
    </s:View>
    and for the service i generate it automatically and this is the code :
    <?php
    *  README for sample service
    *  This generated sample service contains functions that illustrate typical service operations.
    *  Use these functions as a starting point for creating your own service implementation. Modify the
    *  function signatures, references to the database, and implementation according to your needs.
    *  Delete the functions that you do not use.
    *  Save your changes and return to Flash Builder. In Flash Builder Data/Services View, refresh
    *  the service. Then drag service operations onto user interface components in Design View. For
    *  example, drag the getAllItems() operation onto a DataGrid.
    *  This code is for prototyping only.
    *  Authenticate the user prior to allowing them to call these methods. You can find more
    *  information at http://www.adobe.com/go/flex_security
    class AffiliesService {
         var $username = "root";
         var $password = "root";
         var $server = "localhost";
         var $port = "3306";
         var $databasename = "expressway";
         var $tablename = "affilies";
         var $connection;
          * The constructor initializes the connection to database. Everytime a request is
          * received by Zend AMF, an instance of the service class is created and then the
          * requested method is invoked.
         public function __construct() {
                $this->connection = mysqli_connect(
                                              $this->server, 
                                              $this->username, 
                                              $this->password,
                                              $this->databasename,
                                              $this->port
              $this->throwExceptionOnError($this->connection);
          * Returns all the rows from the table.
          * Add authroization or any logical checks for secure access to your data
          * @return array
         public function getAllAffilies() {
              $stmt = mysqli_prepare($this->connection, "SELECT * FROM affilies");         
              $this->throwExceptionOnError();
              mysqli_stmt_execute($stmt);
              $this->throwExceptionOnError();
              $rows = array();
              mysqli_stmt_bind_result($stmt, $row->id, $row->nom, $row->adr, $row->tel, $row->longitude, $row->lattitude, $row->lien);
             while (mysqli_stmt_fetch($stmt)) {
               $rows[] = $row;
               $row = new stdClass();
               mysqli_stmt_bind_result($stmt, $row->id, $row->nom, $row->adr, $row->tel, $row->longitude, $row->lattitude, $row->lien);
              mysqli_stmt_free_result($stmt);
             mysqli_close($this->connection);
             return $rows;
          * Returns the item corresponding to the value specified for the primary key.
          * Add authorization or any logical checks for secure access to your data
          * @return stdClass
         public function getAffiliesByID($itemID) {
              $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename where id=?");
              $this->throwExceptionOnError();
              mysqli_stmt_bind_param($stmt, 'i', $itemID);         
              $this->throwExceptionOnError();
              mysqli_stmt_execute($stmt);
              $this->throwExceptionOnError();
              mysqli_stmt_bind_result($stmt, $row->id, $row->nom, $row->adr, $row->tel, $row->longitude, $row->lattitude, $row->lien);
              if(mysqli_stmt_fetch($stmt)) {
               return $row;
              } else {
               return null;
          * Returns the item corresponding to the value specified for the primary key.
          * Add authorization or any logical checks for secure access to your data
          * @return stdClass
         public function createAffilies($item) {
              $stmt = mysqli_prepare($this->connection, "INSERT INTO affilies (nom, adr, tel, longitude, lattitude, lien) VALUES (?, ?, ?, ?, ?, ?)");
              $this->throwExceptionOnError();
              mysqli_stmt_bind_param($stmt, 'sssdds', $item->nom, $item->adr, $item->tel, $item->longitude, $item->lattitude, $item->lien);
              $this->throwExceptionOnError();
              mysqli_stmt_execute($stmt);         
              $this->throwExceptionOnError();
              $autoid = mysqli_stmt_insert_id($stmt);
              mysqli_stmt_free_result($stmt);         
              mysqli_close($this->connection);
              return $autoid;
          * Updates the passed item in the table.
          * Add authorization or any logical checks for secure access to your data
          * @param stdClass $item
          * @return void
         public function updateAffilies($item) {
              $stmt = mysqli_prepare($this->connection, "UPDATE $this->tablename SET nom=?, adr=?, tel=?, longitude=?, lattitude=?, lien=? WHERE id=?");         
              $this->throwExceptionOnError();
              mysqli_stmt_bind_param($stmt, 'sssddsi', $item->nom, $item->adr, $item->tel, $item->longitude, $item->lattitude, $item->lien, $item->id);         
              $this->throwExceptionOnError();
              mysqli_stmt_execute($stmt);         
              $this->throwExceptionOnError();
              mysqli_stmt_free_result($stmt);         
              mysqli_close($this->connection);
          * Deletes the item corresponding to the passed primary key value from
          * the table.
          * Add authorization or any logical checks for secure access to your data
          * @return void
         public function deleteAffilies($itemID) {
              $stmt = mysqli_prepare($this->connection, "DELETE FROM $this->tablename WHERE id = ?");
              $this->throwExceptionOnError();
              mysqli_stmt_bind_param($stmt, 'i', $itemID);
              mysqli_stmt_execute($stmt);
              $this->throwExceptionOnError();
              mysqli_stmt_free_result($stmt);         
              mysqli_close($this->connection);
          * Returns the number of rows in the table.
          * Add authorization or any logical checks for secure access to your data
         public function count() {
              $stmt = mysqli_prepare($this->connection, "SELECT COUNT(*) AS COUNT FROM $this->tablename");
              $this->throwExceptionOnError();
              mysqli_stmt_execute($stmt);
              $this->throwExceptionOnError();
              mysqli_stmt_bind_result($stmt, $rec_count);
              $this->throwExceptionOnError();
              mysqli_stmt_fetch($stmt);
              $this->throwExceptionOnError();
              mysqli_stmt_free_result($stmt);
              mysqli_close($this->connection);
              return $rec_count;
          * Returns $numItems rows starting from the $startIndex row from the
          * table.
          * Add authorization or any logical checks for secure access to your data
          * @return array
         public function getAffilies_paged($startIndex, $numItems) {
              $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename LIMIT ?, ?");
              $this->throwExceptionOnError();
              mysqli_stmt_bind_param($stmt, 'ii', $startIndex, $numItems);
              mysqli_stmt_execute($stmt);
              $this->throwExceptionOnError();
              $rows = array();
              mysqli_stmt_bind_result($stmt, $row->id, $row->nom, $row->adr, $row->tel, $row->longitude, $row->lattitude, $row->lien);
             while (mysqli_stmt_fetch($stmt)) {
               $rows[] = $row;
               $row = new stdClass();
               mysqli_stmt_bind_result($stmt, $row->id, $row->nom, $row->adr, $row->tel, $row->longitude, $row->lattitude, $row->lien);
              mysqli_stmt_free_result($stmt);         
              mysqli_close($this->connection);
              return $rows;
          * Utility function to throw an exception if an error occurs
          * while running a mysql command.
         private function throwExceptionOnError($link = null) {
              if($link == null) {
                   $link = $this->connection;
              if(mysqli_error($link)) {
                   $msg = mysqli_errno($link) . ": " . mysqli_error($link);
                   throw new Exception('MySQL Error - '. $msg);
    ?>
    and i can't even find an error !! could anyone help me or even give me a solution to read the error report.
    thx.

    so... while no one find the probleme or even give me an answer to it, i search another solution that correspond to my knowledge and i found : As-SQL it's easy to use and while u don't need to manage a lot of data this solution will be helpfull.
    any way, even if i found another solution i still want to know the problem.

  • FLEX with PHP (Overview)

    Hello FLEX-PHP Gurus,
    I am a PHP programmer who wants to start using FLEX.
    I need to create of graphing applications that take huge
    amounts of data from the server.I have the Flex 2 SDK with
    charting. I am using Apache as my web server. I understand that I
    would need an AMF to communicate between PHP and Flex2. What else
    would I need?
    Also, am I losing out on any Flex functionality by not using
    Java technologies at the backend?
    Thanks,
    Rati

    Catch one of the webcasts. That cleared things up for me. web
    service is XML, so it is slower than the binary data transfers (amf
    or weborbs). I am a complete newb to flex...but that is the messag
    that was conveyed, the more data, the bigger the benefit of the amf
    stuff.
    http://www.themidnightcoders.com/blog/.
    I am only using the serbvice though, and it is simple
    compared to what would be required in c# or php to consume the web
    service.
    some benchmarks:
    http://www.jamesward.org/wordpress/2007/04/30/ajax-and-flex-data-loading-benchmarks/

  • Anyone use Flex with php for file upload? PHP Notice:  Undefined index:  Filedata

    My code works. It uploads the file and inputs the file name into a database, but I can't shake this php notice. I think php is looking for multipart/form-data from the HTML form tag.
    <form action="upload.php"  enctype="multipart/form-data"/>
    But I am using flex. The multipart/form-data info is sent as the second default argument of the upload() function. Does anyone have experience with this? Thanks.
    PHP Notice:  Undefined index:  Filedata
    $filename = $_FILES['Filedata']['name'];
    public function selectHandler(event:Event):void {
                    request = new URLRequest(UPLOAD_DIR);
                    try {
                        fileRef.upload(request);
                        textarea1.text = "Uploading " + fileRef.name + "...";
                    catch (error:Error) {
                        trace("Unable to upload file.");
                        textarea1.text += "\nUnable to upload file.";

    Hi, Thanks for your reply !
    Im not getting any errors Flex side, as i say i get a alert message saying the file has been uploaded so . .
    I am using a Wamp server on a windows machine, how do i check the file permissions on both the folder and the php file ?
    Also how do i debug a php file ?
    ANy help would be thankful !

  • Tutorial: The Players demo – Flex, PostgreSQL, PHP/AMF working together

    Digital Showcase LLC has developed this Tutorial and Demo on database entry and update taking advantage of the extended graphics that Flex/Flash  offers, to produce a rich, compelling user interface for presenting Database usage, leveraging PHP and AMF via the Zend Framework.
    Click Here to try the live Demo.
    The 11 page Tutorial along with all the code to do this is available HERE.
    - Alan Gruskoff

    so... while no one find the probleme or even give me an answer to it, i search another solution that correspond to my knowledge and i found : As-SQL it's easy to use and while u don't need to manage a lot of data this solution will be helpfull.
    any way, even if i found another solution i still want to know the problem.

  • Problems with flex and php.

    Hello, my name is Gamaliel Arredondo, i have to develope a project in flash builder 4 using the data service to connect with php, the application has installed the zend framework automatically just like the tutorials said, I use xampp and i have the files in the htdoc location, all the path are correct but when i want to connect to my php classes i receive this message:
    Make sure that Zend Framework is installed correctly and  the parameter "amf.production" is not set to true in the amf_config.ini file  located in the project output folder.     /0/onResultÿÿÿÿ � Uflex.messaging.messages.AcknowledgeMessage correlationId clientId destination messageId timestamp timeToLive headers  body I797BFBCC-250A-A100-9954-68CD2AC82DF5 I2570DA6E-2F76-55E9-2249-000075B2C293  I590AA123-C3CE-5F48-6A94-00002F9B370A  126571301000      ‡G
    I have searched on internet in order to find a solution but i haven't found anything that can help me, so i would like to receive some of help, my email is [email protected], if you can help me i will thank you so much, have a nice day.

    Hello, I am Gamaliel Arredondo, i have solved this problem, the error is in the code, you have a mistake in your code, check it out.
    The way to run the flex applications, in my case, i installed xampp, in the htdoc directory i put the folder with the files of the application and all is working very well, only when the apache is running because if it is stoped the application show error, please review your code and if you have problems you can contact me by e-mail ([email protected]) i also fought with that problem but i could find the solution, i hope to help you.

  • Flex and Php

    FLEX CODE
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" applicationComplete="http.send()">
    <mx:Button x="197" y="198" label="Button" click =
    "testing()"/>
    <mx:Script>
    <![CDATA[
    public function testing():void
    mx.controls.Alert.show("this is the output " +
    http.lastResult.happy);
    ]]>
    </mx:Script>
    <mx:HTTPService id = "http" method="POST" url =
    "PHPDocument1.php" useProxy ="false">
    </mx:HTTPService>
    <mx:TextInput x="260" y="111" id="n"/>
    <mx:TextInput x="182" y="45" id="last"/>
    </mx:Application>
    PHP CODE
    <?php
    $happy = "<happy>cheesey</happy>";
    echo $happy;
    ?>
    The problem I having is for some reason.. it won't even load
    anything! it works with loading XML and TXT files but it doesn' t
    work with Php or my Python scripts.. basically its unable to
    communicate with server-side scripts. What could be the
    problem?

    Your testing function is not being called. You need to set
    the result event like this:
    <mx:HTTPService
    id = "http"
    method="POST"
    result="testing(event)"
    url = "
    http://localhost/PHPDocument1.php"
    useProxy ="false"/>
    You can then get the result in two differnt ways:
    public function testing(evt:ResultEvent):void
    mx.controls.Alert.show("this is the output " +
    http.lastResult.happy);
    trace(evt.result.happy);
    Using evt.result is often more flexible than http.lastResult
    for me since you are able to decouple the result from the call. It
    also is helpful for debugging if there is a problem.
    Vygo

  • Connecting flex with php(wamp)

    i m trying to connect a flex application to a php (wamp server)..bt i m unable to do soo
    ma application runs fine....bt wen i click submit button it shows ..transfering data frm localhost n nothing happens......database is nt updated........
    //flex code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="send_data()">
    <mx:Script>
    <![CDATA[
    import mx.controls.DataGrid
    private function send_data():void {
    userRequest.send();
    ]]>
    </mx:Script>
    <mx:Label x="79" y="89" text="username"/>
    <mx:Label x="79" y="128" text="rolnumber"/>
    <mx:TextInput id="nm" x="153" y="87"/>
    <mx:TextInput x="153" y="126" id="roll"/>
    <mx:Button x="127" y="191" label="submit" id="sub" click="send_data()"/>
    <mx:HTTPService id="userRequest" url="http://localhost/connect.php" useProxy="false" method="POST">
    <mx:request xmlns="">
    <username>{nm.text}</username><rollnumber>{roll.text}</rollnumber>
    </mx:request>
    </mx:HTTPService>
    </mx:Application>
    //php code
    <?php
    mysql_connect("localhost", "root", "") or die("cannot connect");
    mysql_select_db("std_db") or die("cannot select database");
    $q="INSERT INTO `std_db`.`student` (`name` ,`roll`)VALUES ( '$_POST[nm]', $_POST[roll])";
    if(mysql_query($q))
    echo "sucessfully inserted";
    else
    echo" error occured";
    //if($row=mysql_fetch_array($result))
    //echo $row['
    ?>

    naval joshi wrote:
    thanx a lot it worked........wat shd be the code fr display full datbasee nnnnnnshd i usee the datagrid?
    you can use a datagrid if you want, or a tile list, or a list, or an advanced datagrid, it's entirely up to you and what you plan to do with the data.
    The Full working basic code for what you're trying to do is this:
    Flex code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="send_data()">
        <mx:Script>
        <![CDATA[
            import mx.rpc.events.ResultEvent;
            import mx.controls.DataGrid
            private function send_data():void
                userRequest.send();
            private function handleResult(evt:ResultEvent):void
                dg1.dataProvider = evt.result.player;
        ]]>
        </mx:Script>
        <mx:Label x="79" y="89" text="username"/>
        <mx:Label x="79" y="128" text="rolnumber"/>
        <mx:TextInput id="nm" x="153" y="87"/>
        <mx:TextInput x="153" y="126" id="roll"/>
        <mx:Button x="127" y="191" label="submit" id="sub" click="send_data()"/>
        <mx:HTTPService id="userRequest" result="handleResult(event)" url="http://localhost/connect.php" useProxy="false" method="POST">
            <mx:request xmlns="">
                <username>{nm.text}</username><rollnumber>{roll.text}</rollnumber>
            </mx:request>
        </mx:HTTPService>
        <mx:DataGrid id="dg1" x="69" y="261">
            <mx:columns>
                <mx:DataGridColumn headerText="Name" dataField="name"/>
                <mx:DataGridColumn headerText="Roll" dataField="roll"/>
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    PHP Code:
    <?php
        mysql_connect("localhost", "root", "") or die("cannot connect");
        mysql_select_db("std_db") or die("cannot select database");
        if ($_POST["username"])
            $name = mysql_real_escape_string($_POST["username"]);
            $roll = mysql_real_escape_string($_POST["rollnumber"]);
            $query = "INSERT INTO student (name , roll) VALUES ('$name', '$roll')";
            if(mysql_query($query))
                echo "sucessfully inserted";
            else
                echo" error occured";
        $query="SELECT * FROM student";
        $result = mysql_query($query);
        $num_rows = mysql_numrows($result);
        $i=0;
        while ($i < $num_rows)
            $getName = mysql_result($result,$i,"name");
            $getRoll = mysql_result($result,$i,"roll");
            print "<player><name>".$getName."</name><roll>".$getRoll."</roll></player>";
            $i++;
    ?>

  • Flex + amf php server deployment problem

    Hi all,
    After almost a month of research on this problem. I was able to remove all my errors on production but still not able to retrieve data.
    Please help......
    Here is the scenerio details :
    I created a form which will take input from user and store those values in database.you can visit it here on web server :
    http://www.accurateoptics.in/
    I followed all the steps mentioned on adobe's test drive tutorial. It works fine on my local machine with WAMP installation. But the moment,
    I upload it...Bang!!!! there comes the error ::::
    Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: http://www.accurateoptics.in/gateway.php
    I googled again, read a lot of articles and figured out that some changes are required in my gateway.php and amf-config.ini files for production environment.
    Did the necessary changes and uploaded again.Bang!!!!!!! new error comes:::::::
    Channel disconnected before an acknowledgement was received.
    to solve this, again googled a lot and figured out that i need to upload zend framework files so, did that and setting up the path for zend in amf-config.ini.
    uploaded again.
    Now, i am stuck at this point where no error is thrown only an alert box comes with a ok button. also, data is not retrieved from server.
    I dont know what error i am making.here is my amf-config.ini file:::::::::::::
    [zend]
    ;set the absolute location path of webroot directory, example:
    ;Windows: C:\apache\www
    ;MAC/UNIX: /user/apache/www
    webroot =http://www.accurateoptics.in
    ;set the absolute location path of zend installation directory, example:
    ;Windows: C:\apache\PHPFrameworks\ZendFramework\library
    ;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework/library
    ;zend_path =
    zend_path = ./ZendFramework/library
    [zendamf]
    amf.production = true
    amf.directories[]= http://www.accurateoptics.in/services
    here is my gatway.php file :::::::::::::;
    <?php
    ini_set("display_errors", 1);
    //$dir = dirname(__FILE__);
    $dir = '.';
    $webroot = $_SERVER['DOCUMENT_ROOT'];
    //$configfile = "$dir/amf_config.ini";
    $configfile = "amf_config.ini";
    //default zend install directory
    $zenddir = $webroot. '/ZendFramework/library';
    //Load ini file and locate zend directory
    if(file_exists($configfile)) {
    $arr=parse_ini_file($configfile,true);
    if(isset($arr['zend']['webroot'])){
    $webroot = $arr['zend']['webroot'];
    $zenddir = $webroot. '/ZendFramework/library';
    if(isset($arr['zend']['zend_path'])){
    $zenddir = $arr['zend']['zend_path'];
    // Setup include path
    //add zend directory to include path
    set_include_path(get_include_path().PATH_SEPARATOR.$zenddir);
    // Initialize Zend Framework loader
    require_once 'Zend/Loader/Autoloader.php';
    Zend_Loader_Autoloader::getInstance();
    // Load configuration
    $default_config = new Zend_Config(array("production" => false), true);
    $default_config->merge(new Zend_Config_Ini($configfile, 'zendamf'));
    $default_config->setReadOnly();
    $amf = $default_config->amf;
    // Store configuration in the registry
    Zend_Registry::set("amf-config", $amf);
    // Initialize AMF Server
    $server = new Zend_Amf_Server();
    $server->setProduction($amf->production);
    if(isset($amf->directories)) {
    $dirs = $amf->directories->toArray();
    foreach($dirs as $dir) {
    // get the first character of the path.
    // If it does not start with slash then it implies that the path is relative to webroot. Else it will be treated as absolute path
    $length = strlen($dir);
    $firstChar = $dir;
    if($length >= 1)
    $firstChar = $dir[0];
    if($firstChar != "/"){
    // if the directory is ./ path then we add the webroot only.
    if($dir == "./"){
    $server->addDirectory($webroot);
    }else{
    $tempPath = $webroot . "/" . $dir;
    $server->addDirectory($tempPath);
    }else{
    $server->addDirectory($dir);
    // Initialize introspector for non-production
    if(!$amf->production) {
    $server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server));
    $server->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server));
    // Handle request
    echo $server->handle();
    ?>
    Looking for some help!! Thanks in advance..............

    Please elaborate.
    I tried visitng http://www.accurateoptics.in/endpoint.php
    but "page not found " returned
    However, i also tried visitng "http://www.accurateoptics.in/gateway.php"
    it shows me this echo result on page " Zend Amf Endpoint ".
    so, if i m reaching to this place that means my gateway.php and amf-config.ini is fine.
    the problem is somewhere else in any of these three files.

  • Sharing an array between flex and php

    please provide some easy methods because i am new to
    php.

    please provide some easy methods because i am new to
    php.

  • Connecting Flex to PHP returned XML

    Hello! im new to flex and i have a question that i am hoping
    someone can answer. I have a flex app that i am building that needs
    to display a list of dynamic images, preferably with icons. I've
    built the Title list, but i don't know how to connect the
    HTTPService data to the list. the HTTPService is returning XML
    data, so it must be easy. but, as i said, Im really new. Please
    Help Me!!

    "arthurlockman" <[email protected]> wrote in
    message
    news:g7kk4g$177$[email protected]..
    > Hello! im new to flex and i have a question that i am
    hoping someone can
    > answer. I have a flex app that i am building that needs
    to display a list
    > of
    > dynamic images, preferably with icons. I've built the
    list, but i don't
    > know
    > how to connect the HTTPService data to the list. the
    HTTPService is
    > returning
    > XML data, so it must be easy. but, as i said, Im really
    new. Please Help
    > Me!!
    >
    Depending on what you're wanting to do, you can either use a
    Repeater with
    an Image or custom component that contains an Image or you
    can use a List
    based component to display an Image or custom component with
    an Image (or
    SwfLoader, or Loader) in it. There is literally a ton of
    stuff about this
    in the Help. Here are some places you may want to try:
    Help>Flex Start Page>Creating a Simple RIA
    Help>Help Contents>User Interfaces
    - Using Data Providers and Collections
    - Controls
    - Image
    - SwfLoader
    - Using Data Driven Controls
    - Using Item Renderers and Item Editors
    - Dynamically Repeating Controls and Containers
    Here is an example that might get you running fast *if* you
    are not the type
    to read the docs:
    http://examples.adobe.com/flex2/inproduct/sdk/photoviewer/PhotoViewer.html
    HTH;
    Amy

Maybe you are looking for

  • Stock Balances uploading through Mvt type 561

    Hello,         We are uploading Stock Balances by T.Code MB1C through Mvt. Type 561. IN FI-MM Integration T.code OBYC, In transaction key "GBB" I have assigned GL Account "Stock Suspense A/c" for BSA. And in transaction key BSX, I've assigned GL Acco

  • Notification message box of Hyperion Planning when user login

    Can we have a notification message box popup when user login Hyperion Planning or Workspace application? We would like to communicate to the end users by the system instead of just email because some end users may not check the email so frequently. I

  • Connet to domino with notessql

    Hi, i've an odbc connection with a lotus notes database, using notessql driver, in a xp. I've oracle 10g and i'd like to recover data from notes with this odbc connection. Usually i use sql loader when i've to get data from external source like excel

  • Disable 'SAVE' button on 'FILE' menu on some forms using personalization

    Hi there, I need to disable 'SAVE' button on 'FILE' menu on some forms using personalization. Please let me know if you know how to do this. Currently we have done this through custom.pll and we are trying to phase out custom.pll. Any help is appreci

  • Itunes launching, freezing, not reading devices xp, how to fix?

    I tunes  locks up when I launch the website and will not allow me to work with it,