2009-06-03 5 views
0

Code Mon Flex est incapable d'atteindre le PHP, mais quand je le fais normalement il fonctionne commeHttpService Aide

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> 

Répondre

0

il peut être un Problème crossdomain.xml. Essayez de placer un fichier crossdomain.xml (http://localhost/crossdomain.xml) avec le contenu suivant:

<?xml version="1.0"?> 

<cross-domain-policy> 

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

</cross-domain-policy> 

et exécuter l'application à nouveau. Si cela ne fonctionne toujours pas, pouvez-vous ajouter un gestionnaire d'erreur à votre HTTPService, vérifier si vous avez une erreur et si vous le publiez ici pour que nous puissions voir quel est le problème?