0

ログインシステムにフラッシュビルダー4でhttpserviceを使用していますが、サーバーから生のphp未処理データとして結果を取得していますが、ブラウザーで同じファイルを実行すると、MAMPを使用して正しいxmlファイルを取得します。助けてくださいここでの問題はphpコードです:

    <?php

define( "DATABASE_SERVER", "localhost:8888" );
  define( "DATABASE_USERNAME", "root" );
  define( "DATABASE_PASSWORD", "root" );
  define( "DATABASE_NAME", "touch" );

//connect to the database
  $mysql = mysql_connect(DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD) or die(mysql_error());

//select the database
  mysql_select_db( DATABASE_NAME );

//These are the variables that Flex is passing to PHP
  $username = mysql_real_escape_string($_POST["username"]);
  $password = mysql_real_escape_string($_POST["password"]);
  $logincookie = mysql_real_escape_string($_POST["logincookie"]);

//Check the credentials
  $query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
  $result = mysql_fetch_array(mysql_query($query));

//Output the returned query in XML: If returned false output 0 else output the users id
$output = "<?xml version='1.0' encoding='utf-8'?>";
  $output .= "<loginsuccess>";
  if(!$result)
  {
  $output .= $username;
  }else{
  $output .= $username;
  }
  $output .= "</loginsuccess>";

//Output the User Type
  $usrtyp .= "<usertype>";
  $usrtyp .= $result['user_type'];
  $usrtyp .= "</usertype>";

//output all the XML

print ($output);
  print ($usrtyp);

?>

そしてここにリクエストがあります:

<s:HTTPService id="login_user" result="checkLogin(event)" showBusyCursor="true" method="POST"
                   url="login.php" useProxy="false">
        <s:request xmlns="">
            <username>
                {username.text}
            </username>
            <password>
                {password.text}
            </password>
        </s:request>
    </s:HTTPService>
4

1 に答える 1

1

これをHTTPサーバーから実行しているのではなく、ファイルシステム上のhtml / swfファイル自体を参照しているだけなので、PHPは処理されていません。

于 2011-08-19T03:31:45.407 に答える