Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: !!!URGENT!!!-PHP AND FLASH
From: Tani Massimo
Date: Tue, 18 Jul 2000 20:01:08 +0100

hi
someone can help me to change this php3 script(made for html-site) for interaction with flash movie and mysql database?!?
we need to estract some variables like "regia[director], interpreti[actors],ect" to put in a field text in a flash movie.

everybody think to know something about php & flash please write us

thanks
[*]
------------------------------------------------------------------------
<SCRIPT LANGUAGE="php">

$lingua="_eng";

/* connessione */
$dbaddress="myhost";
$login="mysite";
$password="mypassword";
$dbname="myname";
if (!($conn=mysql_connect($dbaddress,$login, $password))) echo "ERRORE: mysql_connect($dbaddress,$login,xxx)<P>\n";
if (!($error=mysql_select_db($dbname, $conn))) echo "ERRORE: mysql_select_db($dbname,$conn)<P>\n";

echo "Search parameters<BR>";
$sql="SELECT C.codice, C.titolo$lingua, C.regia, C.genere$lingua, C.tipo FROM catalogo AS C WHERE C.tipo<>'x'";
echo "Type: ";
if ($Tipo[1]=="")
{
$sql=$sql." AND C.tipo='$Tipo[0]'";
if ($Tipo[0]=="D") echo "documentaries";
else echo "short films";
}
else echo "documentaries and short films";
echo "<BR>";
if ($Titolo<>"")
{
$sql=$sql." AND C.titolo$lingua LIKE '%".addslashes($Titolo)."%'";
echo "Title: $Titolo<BR>";
}
else
{
if ($Genere<>"all")
{
$sql=$sql." AND C.genere$lingua='".addslashes($Genere)."'";
echo "Category: $Genere<BR>";
}
if ($Regia<>"all")
{
$sql=$sql." AND C.regia LIKE '%".addslashes($Regia)."%'";
echo "Director: $Regia<BR>";
}
if ($Interpreti<>"all")
{
$sql=$sql." AND C.interpreti LIKE '%".addslashes($Interpreti)."%'";
echo "Actor: $Interpreti<BR>";
}
if ($Anno<>"all")
{
$sql=$sql." AND C.anno=$Anno";
echo "Year: $Anno<BR>";
}
if ($Formato<>"all")
{
$sql=$sql." AND C.formato LIKE '%".addslashes($Formato)."%'";
echo "Format: $Formato<BR>";
}
if ($Durata<>"all")
{
$sql=$sql." AND (C.durata_min<$Durata OR (C.durata_min=$Durata AND C.durata_sec<=0))";
echo "Max duration: $Durata<BR>";
}
}
$sql=$sql." ORDER BY C.titolo$lingua";

if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
$trovate=mysql_num_rows($result);
if ($trovate>1) echo "<B>$trovate</B> films found<P>";
else if ($trovate>0) echo "<B>$trovate</B> film found<P>";
else echo "<B>no</B> films found<P>";

if ($trovate>0)
{
echo "Choose <IMG SRC=\"Dettagli.gif\"> to see the film details.<BR>\n";
echo "Choose <IMG SRC=\"Spesa.gif\"> to put the film in your shopping cart.<P>\n";
echo "<TABLE BORDER=\"0\" CELLSPACING=\"5\" CELLPADDING=\"2\">\n";
echo "<TR><TD></TD><TD><B>title</B></TD><TD><B>type</B></TD><TD><B>director</B></TD><TD><B>category</B></TD></TR>\n";
echo "<TR BGCOLOR=\"000000\"><TD COLSPAN=\"5\"><IMG SRC=\"Null.gif\" WIDTH=\"1\" HEIGHT=\"1\"></TD></TR>\n";
while ($datarecord=mysql_fetch_row($result))
{
echo "<TR><TD><A HREF=\"Javascript:scheda($datarecord[0])\"><IMG SRC=\"Dettagli.gif\" BORDER=\"0\" ALT=\"details\"></A>";
echo "<A HREF=\"Javascript:carrello($datarecord[0])\"><IMG SRC=\"Spesa.gif\" BORDER=\"0\" ALT=\"shopping cart\"></A></TD>\n";
echo "<TD><B>$datarecord[1]</B>&nbsp;&nbsp;</TD>";
echo "<TD>";
if ($datarecord[4]=="c") echo "short";
else echo "doc";
echo "&nbsp;&nbsp;</TD>";
echo "<TD><I>$datarecord[2]</I>&nbsp;&nbsp;</TD><TD>$datarecord[3]&nbsp;&nbsp;</TD></TR>\n";
echo "<TR><TD></TD><TD COLSPAN=\"4\" BGCOLOR=\"9400C6\"><IMG SRC=\"Null.gif\" WIDTH=\"1\" HEIGHT=\"1\"></TD></TR>\n";
}
echo "</TABLE>";
}
else echo "Please change search parameters<P>\n";
echo "<P><HR>";
echo "<FORM METHOD=\"GET\" ACTION=\"ric.php3\">\n";
echo "<TABLE BORDER=\"0\">";
echo "<P><INPUT TYPE=\"submit\" VALUE=\"Search\"> <INPUT TYPE=\"reset\" VALUE=\"reset\"><P>\n";

echo "<TR><TD><B>Type:</B></TD><TD>";
echo "<INPUT TYPE=\"checkbox\" NAME=\"Tipo[]\" VALUE=\"d\" CHECKED> documentaries<BR>\n";
echo "<INPUT TYPE=\"checkbox\" NAME=\"Tipo[]\" VALUE=\"c\" CHECKED> short films\n";
echo "</TD></TR>\n";

echo "<TR><TD><B>Title:<BR>(or a part of)</B></TD><TD><INPUT TYPE=\"text\" SIZE=\"30\" NAME=\"Titolo\"></TD></TR>\n";

echo "<TR><TD><B>Category:</B></TD><TD><SELECT SIZE=\"1\" NAME=\"Genere\">\n";
echo "<OPTION SELECTED>all</OPTION>\n";
$sql="SELECT DISTINCT genere$lingua FROM catalogo WHERE tipo<>'x' ORDER BY genere$lingua";
if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
while ($datarecord=mysql_fetch_row($result)) echo "<OPTION>$datarecord[0]</OPTION>\n";
echo "</SELECT></TD></TR>\n";

echo "<TR><TD><B>Director:</B></TD><TD><SELECT SIZE=\"1\" NAME=\"Regia\">\n";
echo "<OPTION SELECTED>all</OPTION>\n";
$sql="SELECT DISTINCT regia FROM catalogo WHERE tipo<>'x' ORDER BY regia";
if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
$count=0;
while ($datarecord=mysql_fetch_row($result))
{
$regia=split(", ",$datarecord[0],3);
$regias[$count]="$regia[0]";
$regias[$count+1]="$regia[1]";
$regias[$count+2]="$regia[2]";
$count=$count+3;
}
sort($regias);
$temp="";
$count=0;
while ($count<count($regias))
{
if ($temp<>$regias[$count]) echo "<OPTION>$regias[$count]</OPTION>\n";
$temp=$regias[$count];
$count++;
}
echo "</SELECT></TD></TR>\n";

echo "<TR><TD><B>Actor:</B></TD><TD><SELECT SIZE=\"1\" NAME=\"Interpreti\">\n";
echo "<OPTION SELECTED>all</OPTION>\n";
$sql="SELECT DISTINCT interpreti FROM catalogo WHERE tipo<>'x'";
if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
$count=0;
while ($datarecord=mysql_fetch_row($result))
{
$attore=split(", ",$datarecord[0],10);
$attores[$count]="$attore[0]";
$attores[$count+1]="$attore[1]";
$attores[$count+2]="$attore[2]";
$attores[$count+3]="$attore[3]";
$attores[$count+4]="$attore[4]";
$attores[$count+5]="$attore[5]";
$attores[$count+6]="$attore[6]";
$attores[$count+7]="$attore[7]";
$attores[$count+8]="$attore[8]";
$attores[$count+9]="$attore[9]";
$count=$count+10;
}
sort($attores);
$temp="";
$count=0;
while ($count<count($attores))
{
if ($temp<>$attores[$count]) echo "<OPTION>$attores[$count]</OPTION>\n";
$temp=$attores[$count];
$count++;
}
echo "</SELECT></TD></TR>\n";

echo "<TR><TD><B>Year:</B></TD><TD><SELECT SIZE=\"1\" NAME=\"Anno\">\n";
echo "<OPTION SELECTED>all</OPTION>\n";
$sql="SELECT DISTINCT anno FROM catalogo WHERE tipo<>'x' ORDER BY anno";
if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
while ($datarecord=mysql_fetch_row($result)) echo "<OPTION>$datarecord[0]</OPTION>\n";
echo "</SELECT></TD></TR>\n";

echo "<TR><TD><B>Format:</B></TD><TD><SELECT SIZE=\"1\" NAME=\"Formato\">\n";
echo "<OPTION SELECTED>all</OPTION>\n";
$sql="SELECT DISTINCT formato FROM catalogo WHERE tipo<>'x' ORDER BY formato";
if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
$count=0;
while ($datarecord=mysql_fetch_row($result))
{
$formato=split(", ",$datarecord[0],3);
$formatos[$count]="$formato[0]";
$formatos[$count+1]="$formato[1]";
$formatos[$count+2]="$formato[2]";
$count=$count+3;
}
sort($formatos);
$temp="";
$count=0;
while ($count<count($formatos))
{
if ($temp<>$formatos[$count]) echo "<OPTION>$formatos[$count]</OPTION>\n";
$temp=$formatos[$count];
$count++;
}
echo "</SELECT></TD></TR>\n";

echo "<TR><TD><B>Max duration:<BR>(minuts)</B></TD><TD><SELECT SIZE=\"1\" NAME=\"Durata\">\n";
echo "<OPTION SELECTED>all</OPTION>\n";
$sql="SELECT DISTINCT durata_min FROM catalogo WHERE tipo<>'x' ORDER BY durata_min";
if (!($result=mysql_query($sql, $conn))) echo "ERRORE: mysql_query($sql,$conn)<BR>\n";
while ($datarecord=mysql_fetch_row($result)) echo "<OPTION>$datarecord[0]</OPTION>\n";
echo "</SELECT></TD></TR>\n";

echo "</TD></TR></TABLE>\n";

echo "<P><INPUT TYPE=\"submit\" VALUE=\"Search\"> <INPUT TYPE=\"reset\" VALUE=\"reset\">\n";
echo "</FORM>\n";
</SCRIPT>


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: !!!URGENT!!!-PHP AND FLASH, Victor Villen

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]