2009-06-03 63 views
0

我的Flex代碼是無法達到的PHP,但是當我通常做它像HttpService的幫助

http://localhost/search/populate.php?urlWeb=http://www.google.com

$url = addslashes($_GET['urlWeb']); 

if(!$url) 
{ 
    die("You need to define a URL to process."); 
} 
else if(substr($url,0,7) != "http://") 
{ 
    $url = "http://$url"; 
    $output = "<loginsuccess>"; 
    $output .="yes"; 
    $output .= "</loginsuccess>"; 
    print($output); 
} 

<mx:HTTPService id="addWeb" resultFormat="object" result="Added(event)" showBusyCursor="true" method="GET" url="http://localhost/search/populate.php" useProxy="false"> 
     <mx:request xmlns=""> 
      <urlWeb> 
       {urlWeb.text} 
      </urlWeb> 
     </mx:request> 
    </mx:HTTPService> 

回答

0

它可能是一個crossdomain.xml問題。試着將crossdomain.xml文件(http://localhost/crossdomain.xml)具有以下內容:

<?xml version="1.0"?> 

<cross-domain-policy> 

    <allow-access-from domain="*" to-ports="*" secure="false" /> 

</cross-domain-policy> 

,並再次運行應用程序。如果它仍然無法運行,請將錯誤處理程序添加到HTTPService中,檢查是否有錯誤,如果在此處發佈,那麼我們可以看到問題所在?