Hey all,
I have a php script which receives a variable that the user entered and submitted. The mysql query in the script displays/echos a $filename=‘filename’ depending on the word entered by the user in flash…
I cannot get the variable filename to display in flash yet it works fine when i test the php script.
Here is my php script:
<?php
$word = $_POST['word'];
if (!isset($_POST['submit']))
{
?>
<html>
<head>
<title>Test Word</title>
</head>
<body>
<form action="<?php echo $PHP_SELF; ?>" method="post">
<table border="0">
<tr><td>Word:</td><td>
<input type="text" name="word" maxlength="60">
</td></tr>
<tr><td colspan="2" align="right">
<input type="submit" name="submit" value="submit">
</td></tr>
</table>
</form>
</body>
</html>
<?php
}
else
{
//break;
$word = trim($word);
if ($word)
{
//$filename = "Blank" ;
//echo $word.'empty';
//Connect to the database
include("connect.php");
$data = mysql_query("SELECT videos.ID, videos.filename, videos.path, words.IDvideo FROM videos, words WHERE (videos.ID = words.IDvideo) and (words.word LIKE '%$word%')")
or die(mysql_error());
$numrows = mysql_num_rows( $data );
if ($numrows != 0)
{
while ($linha = mysql_fetch_array( $data ))
{
$filename = trim($linha['filename']);
echo $filename;
}
}
else
{
$filename = 'blank';
echo $filename;
}
}
}
?>
and here is my actionscript code on my submit button in flash:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]on[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]loadVariablesNum[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]‘http://www.mydomain.com/php/index.php’[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#FF0000]‘POST’[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#0000FF]loadVariablesNum[/COLOR][COLOR=#000000]([/COLOR][COLOR=#FF0000]‘http://www.mydomain.com/php/index.php’[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#FF0000]‘GET’[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]
Also my variables on the field where the users enter their words is “words” and the variables on the dynamic textfield which will be recieving the filename is “filename”.
Cheers in advance
Thanks