Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI search script that accepts Flash variables

Status
Not open for further replies.

Shilohcity

Technical User
Jul 12, 2000
136
GB
Hi there

I am trying to find a straightforward (and hopefully free) CGI script that I can run to search within my website. The website is written primarily in Flash so something that accepts input from Flash (mostly everything I figured except the scripts I have tried so far, darn it!!). Any suggestions or advice on this would be most welcome.

Thanks
Justin
 
In order to get this to work, you need to edit both your Flash movie and your Perl script.

First, the Flash movie:

Within the movie, you must find the buttons that you are going to use to interact with the perl script. When you find them, make sure that they are sending variables. The variables that they send are going to be used by the cgi script. In Flash, when you create a GetUrl action, there is a dropdown box that says Don't Send variables. When you click it, you can choose Send By Post and Send By Get. I suggest you click Send By Post. Since you are searching your website, you will have to make sure that the text field within Flash has a name. This is pertanent to the entire piece.

After you have that done, you will have to edit your cgi script to accept the variables from the Flash movie. You can parse out the variables like you would any form variables. You can either use CGI.pm to parse out the variables or use this:

[tt]

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
[/tt]

If you need any more help, feel free to contact me. malice365@hotmail.com.

I hope this helps.

-Vic





vic cherubini
malice365@hotmail.com
====

Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director

Wants to Know: Java, Cold Fusion, Tcl/TK

====
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top