Its working now....
Thank you very much
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>";
}
?>