Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing multiple vars through PHP?

Status
Not open for further replies.

vcherubini

Programmer
May 29, 2000
527
US
Hello:

I am having a might bit of trouble with a PHP/Flash page I am working on.

I have a database wherein I need to select data, and print it to a Flash piece.

I can get that to work fine:

[tt]

<?php

$var1 = &quot;cool&quot;;
echo &quot;var1=&quot;.$var1;

?>

Where var1 is a variable text field in Flash. That works fine.

Here is the dilemma, say I have two fields in the same Flash movie, var1 and var2, and I want to input data into them from the PHP script.

I have my Actionscript as:

[tt]
loadVariablesNum(&quot;load.php&quot;,0,&quot;POST&quot;);
[/tt]

That will just load the first variable into Flash piece and nothing else. If I were to have a page called load2.php, and pass in var2 that way, it would work fine. However, there will be more than two variables loaded (in excess of 20) and having 20 PHP pages that do one thing is not desireable.

How can I go about making something like this work:

[tt]

<?php
$var1 = &quot;cool&quot;;
$var2 = &quot;vic&quot;;
echo &quot;var1=&quot;.$var1;
echo &quot;var2=&quot;.$var2;

?>

[tt]

Any help on as how to make that work is very appreciated.

Thank you.

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
From the Help files:

Obtaining variables from a remote file
Use the Load Variables statement, which is one of the parameters of Load Movie, to read data from a text file or text generated by a CGI script, and set the values for variables in a movie or movie clip. For example, if a user submits an order form, you might want a confirmation screen to display an order number gathered from a file on a remote server.

With Load Variables, the text at the URL must be in the standard MIME format application/x- (a standard format used by CGI scripts). Any number of variables can be specified. For example, this phrase defines several variables:

company=Macromedia&address=600+Townsend&city=San+Francisco&zip=94103


Also suggest you have a look at this:


Or if the link above doesn't work, go to and search for load variable php

84% Flash : An overview of integrating Flash with a database

;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top