Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / July 2008



Tip: Looking for answers? Try searching our database.

sending variables from flash to PHP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wishRaj - 28 Jan 2008 11:18 GMT
Hi everyone,
I have a problem while sending variables from flash to PHP
Here is the code:

submit.onPress = function ()
{
    c = new LoadVars ();
    c.nme = "MyName";
    c.sendAndLoad ("getVars.php", Reply, "POST");
}

PHP Code:

<?php
$name = $_POST['nme'];
print "Your name is ". $name . ".<br>";
?>

What am i doing wrong here.
I am getting an error saying    Notice: Undefined index: name in  
\xxx\getVars.php on line 5

Please help me. Thanks in advance

:confused;
[djdomain] - 28 Jan 2008 21:30 GMT
You have not declared "Reply"
submit.onPress = function ()
{
c = new LoadVars ();
Reply = new LoadVars ();
c.nme = "MyName";
c.sendAndLoad ("getVars.php", Reply, "POST");
}
wishRaj - 29 Jan 2008 05:40 GMT
Its working now....
Thank you very much
MYSCREENNAMEISUNAVAILABLE - 24 Mar 2008 04:16 GMT
I used your corrected AS and php file without modification except for echo and
it DIDN'T work. I am using mySQL 4  (no mysqli) and php4. I've also followed
David Powers' book and had no luck.
I am getting a similar error saying Notice: Undefined index: name etc.
I also created a button with the instance, submit.

PHP Code:

<?php
$name = $_POST['nme'];
echo "Your name is ". $name
?>

submit.onPress = function ()
{
c = new LoadVars ();
Reply = new LoadVars ();
c.nme = "MyName";
c.sendAndLoad ("getVars.php", Reply, "POST");
}  
===================== I also searched adobe.com and found a whitepaper, but,
alas, to no avail.

Using LoadVars.send
format = loadVarsObject.send( url, target, method ), where all are expressions
In your sample, you want to send the letter of the tab you selected so that
the PHP script can use it to
query the database. So a LoadVars object must be created and one of its
properties must be set to that
letter. Before looking at the code in the sample, here is an example in which
a value is assigned to a
property of a newly created LoadVars object and sent to a PHP script:
var
c = new LoadVars();
c.thisLetter = "A";
c.send("dbquery.php","_self","POST");
The script reads that property as a POSTed variable and uses it to query the
database and display the
information found:
<?php
mysql_connect("servername","username","password");
mysql_select_db("dbname");
$qr = mysql_query("SELECT
* FROM contacts WHERE LEFT(lastName,1) =
'".$HTTP_POST_VARS['thisLetter']."'");
// display
visitors row (1)
$nrows = mysql_num_rows($qr);
for ($i=0; $i < $nrows; $i++) {
  $row = mysql_fetch_array($qr);
  echo $row['lastName'].", ".$row['firstName']."<br>";
  echo " ".$row['phone']." ".$row['email']."<Br>";
  echo " ".$row['picFile'].":
".$row['caption']."<Br><Br>";
}
?>
Aglossal - 07 Apr 2008 03:40 GMT
I am looking for Flash to ASP, but I think I can work something out from your PHP code, thanks
vanessalewis - 23 Jul 2008 12:57 GMT
Does this work with Vista ?

Anthony O'Hare

http://www.advanceddatarecovery.co.uk http://www.inkcartridgesuk.co.uk http://www.datarecovery24.co.uk
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.