Jump to content


Photo

[help] sending PHP variable to flash?


  • Please log in to reply
2 replies to this topic

#1 csj16

csj16

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 11 March 2008 - 08:55 AM

I'm wondering if someone can help me. I have a flash document and I'm trying to get dynamic information from a PHP file into the flash file. Hope this makes sense

Inside the flash document I have a text box (var: who)
the AS I'm using is

onClipEvent (load) {
loadVariables("load.php", this, "GET");
}

Inside the PHP file I'm using the following code to send the data to the flash file:

<?php

$user = $_GET['username'];

$person = "Username: $user";

echo "who=$person&";

?>

This doesn't print anything!? But if I change the value of $user to 'something' and not $_GET then it works perfectly. Am I doing something wrong? I need to read the value of $_GET and send it to the flash document. I know that value isn't empty because if I view the page itself it shows up, its just not sending to flash. Have I done something wrong?

I would really appreciate some help. :angrylooking: :P

#2 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 12 March 2008 - 04:25 PM

Moved to probably a more useful forum.

#3 dotbart

dotbart

    Young Padawan

  • Members
  • Pip
  • 141 posts
  • Gender:Male
  • Location:Diepenbeek
  • Interests:Webdesign, Webdeveloppement, DJ, ...

Posted 15 March 2008 - 04:53 PM

why are you using the : ?

try sending them as:
echo "who=" . $user;

or many variables need an output like this:
id=1&title=This+Is+My+Title&date=2008-03-16&who=dotbart

In flash, I allways use something like this:
var lvContent:LoadVars = new LoadVars();
lvContent.load("http://myhost.com/myvarstoflash.php?username=dotbart");
trace("Who: " + lvContent.who);
//Outputs: Who: dotbart





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users