Hello all,

I am new to flex and am just starting out. Please forgive me if i am asking
noob questions.
I looked at the example at
http://devzone.zend.com/article/11-Integrating-Adobe-Flex-and-PHP and tried
to make it work for firebird.

I have a linux box at 192.168.0.238 which has apache and also php and
firebird. I know that they work together. 

following the example I have changed the request.php, trial.mxml and my
firebird database as below. I am using flex3 beta 2 and when i move
everything to the linux box and try to run it at
http://192.168.0.238/trial/bin/trial.html, it loads but an error pops up
which is :

"An action script error has occured"
[RPC Fault faultString="Security error accessing url"
faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
        at
mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:211]
        at
mx.rpc::Responder/fault()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\rpc\Responder.as:56]
        at
mx.rpc::AsyncRequest/fault()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:110]
        at
DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\flex_3_beta2\sdk\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368]
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/redirectEvent()

so i followed instructions and placed a crossdomain.xml file at
192.168.0.238/crossdomain.xml
and when that still did not work, i placed it in all the subdirectories..
restarting the http service and I see no change and am still getting the
error.

Is this an issue with the flex_3 sdk or am i doing something really noobish?

Can anyone please help?

suomaf
=====trial.mxml==========
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute"
creationComplete="userRequest.send()">
<mx:HTTPService id="userRequest"
url="http://localhost/trial/bin/request.php"; useProxy="false" method="POST">
   <mx:request xmlns="">
  
<username>{username.text}</username><emailaddress>{emailaddress.text}</emailaddress>
   </mx:request>
   </mx:HTTPService>
<mx:Form x="22" y="10" width="493">
   <mx:HBox>
   <mx:Label text="Username"/>
   <mx:TextInput id="username"/>
   </mx:HBox>
   <mx:HBox>
   <mx:Label text="Email Address"/>
   <mx:TextInput id="emailaddress"/>
   </mx:HBox>
   <mx:Button label="Submit" click="userRequest.send()"/>
   </mx:Form>
</mx:Application>
======trial.mxml end===============


request.php 
============================
<?
$dbConnection =
ibase_connect("192.168.0.238:/opt/firebird/database/usersdb.fdb","sso","password");
if(!$dbConnection)
{
        die('Could not connect: ' . ibase_errmsg());
}
if($_POST["username"] AND $_POST["emailaddress"])
{
        $query = "insert into tbl_users values (gen_id(userid_gid,1),'" .
$_POST["username"] . "' , '" . $_POST["emailaddress"] . "');";
        $result = ibase_query($dbConnection,$query);
        if(!$result)
        {
                echo "Error. Cannot perform query: ". $query;
        }
}
$query = "select * from tbl_users";
$result = ibase_query($query);
if(!$result)
{
        echo "Error. Cannot perform query: ". $query;
}

$return = "<users>";
while ($row = ibase_fetch_row($result))
{
        $return .= "<user><userid>" . $row[0];
        $return .= "</userid><username>" . $row[1];
        $return .= "</username><emailaddress>" . $row[2];
        $return .= "</emailaddress></user>";
}
$return .= "</users>";
print ($return);

// clear memory
ibase_free_result($result);
ibase_free_query($query);
ibase_close($dbConnection);
?>
===============end request.php=================
-- 
View this message in context: 
http://www.nabble.com/trying-to-get-flex-%2B-php-%2B-firebird-to-work-tf4950235.html#a14173516
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to