I am trying to make a search form in flash that sends the query back to flash. I have a simple search page that works fine and parses the variables for flash to read but am having trouble getting this to send back to the flash document.
here is the php script:
<?php
if(!$find) {
} else if($find) {
include('common.php');
if((!$any) || ($any == "")) { $any = ""; }
$query = "
SELECT *,
MATCH(id, name, info, booth) AGAINST ('$any' IN BOOLEAN MODE) AS id
FROM booth
WHERE MATCH(id, name, info, booth) AGAINST ('$any' IN BOOLEAN MODE)";
$search = mysql_query($query);
if(!$search) {
echo mysql_error()."$query";
}
if(mysql_num_rows($search) > 0) {
while($row = mysql_fetch_array($search)) {
$boothnum=$row['booth'];
$company=$row['name'];
$desc=$row['info'];
echo "&boothnum=$boothnum&company=$company&desc=$desc";
}
}
else {
echo "&none=Nothing Found";
}
}
?>
for the submit button in flash I want to create a function to post the form.
here is the Actionscript:
searchVars=new LoadVars();
searchVars.onLoad=function(ok){
if(ok){
data_clip.booth.text=this.boothnum;
data_clip.name.text=this.company;
data_clip.info.text=this.desc;
}else{
no_results.text=this.none;
}
}
function search(){
searchVars.sendAndLoad("search.php?find=any", searchvars, + any.text , "POST");
}