Send more than one variable in php to flash, easy but I can't do it!

Hi,

I want to send more than one variable from php to flash.

This is what I am using

echo "username=$username && returned_password=$password";

What do I do.

Thanks

if my php to flash memory serves me right…


echo 'username=$username&returned_password=$password';

wrong

echo “username=”.$username."&returned_password=".$password;

yeah, forgot for a sec that php doesn’t interpolate with single quotes.

you could do any of these:


echo "username=".$username."&returned_password=".$password; // double quote method

echo 'username='.$username.'&returned_password='.$password; // single quote method

echo "username=$username&returned_password=$password"; //interpolated method

i prefer single quote method usually b/c you don’t have to use escape backslashes to echo a double quote (ie echo “"text_in_quotes"”; )

Thanks bwh2!

using this method:

echo “username=”.$username."&returned_password=".$password; or
echo ‘username=’.$username.’&returned_password=’.$password;

The returned_password kept adding a ‘space’ at the end, drove me crazy as the password not verify?

If I use this

echo ‘returned_password=’.$password.’&username=’.$username;

It works fine and doesn’t add a space! Any ideas why this is?

echo ‘username=’.$username.’&returned_password=’.$password;

WEIRD WHEN I cut and paste the code above there is a space in $password, even though it looks fine in my editor. ultra edit and when I am typing this :deranged:

yeah, for some reason the forums were adding weird spaces in there. i would just retype it in my own editor.

Maybe try learning JSON

JSON.org

i’m using the method above to send multiple variables to flash, and i keep getting all the html code after the </embed> tag listed along with my last variable. here’s my code:
include(“connection.php”);
mysql_connect($hostname,$username, $password) OR DIE (“Unable to connect to database! Please try again later.”);

  mysql_select_db($dbname);
  $query = "SELECT * FROM $usertable";
  $result = mysql_query($query);
                        
  $fields = mysql_fetch_array($result);
  $question = $fields[0];
  $answer1 = $fields[1];
  $answer2 = $fields[2];
                    
  echo 'question='.$question.'&answer1='.$answer1.'&answer2='.$answer2;
  ?>

also, i had this working pretty well on a valueweb server and just moved it to a godaddy server for testing, and that’s where my problems came from. does godaddy just really suck?

no, it has a different version of php, thats why “i hate php”

no defective, php hates you.

:), got me