That's because you're getting a fatal error from PHP, and therefore the 
output from php is not valid amf. You can either point to 
debuggateway.php instead (if you're using amfphp 1.2), or you can 
install Charles debugging proxy or ServiceCapture to read the error, or 
you can call your service from the service browser, which can read fatal 
errors properly.

Patrick

Cameron Ray a écrit :
>
> I'm getting some troubs from Flex using AMFPHP remoting.  I'll try to 
> make this as brief as possible.  I'm receiving the dreaded 
> "NetConnection. Call.BadVersion" .
>
>
> It's a simple login service to check a username & password against the 
> mySQL DB.  It works fine if I don't try to encrypt the password using 
> the mcrypt module.  Unfortunately, I NEED to use this encryption 
> module so that existing users can login using this app.  I've tried 
> about every way I know how....still having problems.  I'll post the 
> code below....please let me know if there's any ideas:
>
> ############ ### START CODE ############ ######### ###
> <?php
>
> include('dbConnectV alues.php' );
>
> $EnCRYPTEdSECRETkEY = "mySuperSecretKEY" ;
> $alg  = MCRYPT_BLOWFISH;
> $mode = MCRYPT_MODE_ CBC;
> $iv = "&%`>";
>
> class VLlogin {
> function VLlogin()
> {
> $this->methodTable = array (
> "login" => array (
> "description" => "Logs into Vidego Lite!",
> "arguments" => array("uName" , "pWrd"),
> "access" => "remote"),
> "encryptText" => array(
> "description" => "Encrypts pwd",
> "arguments" => array("$someText" ),
> "access" => "remote")
> );
> }
>
> function encryptText( $someText) {
> $encrypted_data = mcrypt_encrypt( $alg, $EnCRYPTEdSECRETkEY , 
> $someText, $mode, $iv);
> $plain_text = base64_encode( $encrypted_ data);
> return $plain_text;
> }
>
> function login($uName, $pWrd) {
>
> $db_name = dbConnectValues: :$database;
> $server = dbConnectValues: :$dbserver;
> $username = dbConnectValues: :$username;
> $password = dbConnectValues: :$password;
>
>
> $fuser = $uName;
> $fpwd = $pWrd;
> //$fpwd = base64_encode( base64_encode( $fpwd));
> $fpwd = encryptText( $fpwd);
> $connection = @mysql_connect( $server,$ username, $password) or 
> die("Cound not connect to database.");
> mysql_select_ db($db_name, $connection) or die("Could not select 
> database.");
> $sql = "SELECT * FROM users WHERE username = '$fuser' AND password = 
> '$fpwd'";
>
> $result = mysql_query( $sql);
> $numRows = mysql_num_rows( $result);
>
> if ($numRows > 0) {
>
> $userInfo = mysql_fetch_ assoc($result) ;
> //$userInfo[ "password" ] = base64_decode( base64_decode( $userInfo[ 
> "password" ]));
> return $userInfo;
>
> } else {
> return 'Please ensure your username or password are correct.';
> }
> }
> }
>
> ?>
>
>
>
>
> -Cameron
>  

Reply via email to