calling all flash gurus for this challenge

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   calling all flash gurus for this challenge
olm75
CZ Newbie
olm75 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 05, 2004
0.00 posts per day
Posts: 10
Points: 621
   
ok can anybody give me an example of a search form in flash mx or 2004 with some combo and text boxes to search MySQL database using PHP.......and have the results look like this : [ Register or login to view links on this board.] ........



Back to top Reply with quote
#2   re: calling all flash gurus for this challenge
bpat1434
CZ Newbie
bpat1434 has been a member for over 19 year's 19 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jan 19, 2005
0.00 posts per day
Posts: 21
Points: 783
AIM Address Yahoo Messenger MSN Messenger 
Ok, so here's the flash side of it:

Create a comboBox with ID "combobox" (no quotes), and an Input Text wth ID "input" (no quotes). Now, add a button with ID "search" (no quotes). Now, all those should be on the same frame (layers don't matter). Once that is done, think about what you're going to be sending. Is it sensative info? Probably not. So the search criteria can be in the URL. So from that, we can now code the rest of the flash.

Add a layer and name it Actions (if you don't have one already). On the frame that the movie stops AND all the input/combobox/button objects are viewable, add this code:

choice = new Object();
choice.change = function(){
    $combo = this.selectedItem.data;
}
combobox.addEventListener("change", choice);

search.onRelease = function(){
    $input = input.text;
    getURL("http://www.domain.com/path/to/script.php?combobox="+combo+"&text="+$input);
}


That should work to send the variables to a php script via the URL.

Then just set up your PHP page to grab the varaibles/strings from the URL and itterate through the Database to pull the records that match the query.

<?php
$combo = $_REQUEST['combobox'];
$text = $_REQUEST['text'];

$sql = "SELECT * FROM `table_name` WHERE combo='$combo' AND text='$text' ORDER BY id DESC";
$result = mysql_query($sql);
echo '<table border="1" width="100%">';
while($out = mysql_fetch_array($result)){
    /* Set up table and echo through it */
    echo '<tr><td>'.$out['id'].'</td>'
          .'<td>'.$out['title'].'</td>'
          .'<td>'.$out['post_date'].'</td>'
          .'<td>'.$out['description'].'</td>'
          .'</tr>';
}
echo '</table>';
?>


But, you can pull whatever variables you want from teh database. If you know php, you can easily modify the script as needed.

~Brett


Back to top Reply with quote
#3   re: calling all flash gurus for this challenge
olm75
CZ Newbie
olm75 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Dec 05, 2004
0.00 posts per day
Posts: 10
Points: 621
   
ok thanks for the input, now can u tell me how i can fix this if i give u all the info for my search page can u help me fix it......i was almost there....can u give me ur email i can send it there



Back to top Reply with quote
#4   re: calling all flash gurus for this challenge
bpat1434
CZ Newbie
bpat1434 has been a member for over 19 year's 19 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jan 19, 2005
0.00 posts per day
Posts: 21
Points: 783
AIM Address Yahoo Messenger MSN Messenger 
unfortunately I dont' have the time to do that.

If you tell me what problems you're having, I'll be glad to help you work through them.



Give a man a fish, he'll eat for a day.
Teach a man to fish, and he'll eat for life.


I'm not going to hand you your finished product, but I will help you get to it.

~Brett



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum