Hi everyone.
I have created a website on Flex builder 3 and it works fine on my local server,
but when I upload it to my host i get this error from flex.
ActionScript Code:
Error [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
And the php files doesn't return any information.
I try to use crossdomain policy but it doesn't work.
here's my php file that returns the xml.
PHP Code:
<?php
require_once("config.php");
class infoRetrieve
{
private $connection;
function infoRetrieve($table_name)
{
$this->conn();
mysql_query("SET NAMES utf8");
$query = $this->selectAllQuery($table_name);
$xml = $this->returnXML($query);
print_r($xml);
}
public function conn()
{
$this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS);
if(!$this->connection)
{
die("database connection faled" . mysql_error());
}
else
{
$db_select = mysql_select_db(DB_NAME, $this->connection);
if(!$db_select)
{
die("database selecition faled" . mysql_error());
}
}
}
public function selectAllQuery($table_name)
{
if(isset($table_name))
{
$query = mysql_query("SELECT * FROM {$table_name}");
}
return $query;
}
public function returnXML($info)
{
$xml = "<root>";
if(isset($info))
{
while($row = mysql_fetch_array($info))
{
for($i = 0; $i < (count($row)/2); $i++)
{
$xml .= "<item{$i}>";
$xml .= $row[$i];
$xml .= "</item{$i}>";
}
}
}
else
{
echo "Error";
}
$xml .= "</root>";
return $xml;
}
public function closeConn()
{
if(isset($this->connection))
{
mysql_close($this->connection);
unset($this->connection);
}
}
}
?>
The php version on my local servar is 5.
On host server is 4. Can this be the problem ?