Re: flash/php problem
| From: | Micah Stevens | Date: | Wed, 08 Mar 2006 15:18:40 +0000 |
| Subject: | Re: flash/php problem | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41408@lists.php.net to get a copy of this message | ||
Why not have a play.php which does this:
<?
query("update hitcounter set plays = plays+1 where file = {$_GET['file']}");
header("Location: play.swf?file={$_GET['file']}");
?>
Just a simple redirect. The user wouldn't even notice.
-Micah
On Wednesday 08 March 2006 6:30 am, Hoz wrote:
> Here is a light but usefull Flash mp3 player :
> http://jeroenwijering.com/?item=Flash_Single_MP3_Player
> (thanks to the author ;))
>
> i wanted it to be dynamic :
> in list.php, i list some mp3 songs from a Mysql database.
> i want each song to be played in the flash player.
>
> looks like :
> Artist #1 - <embed src=play.swf?file=file1.mp3>
> Artist #2 - <embed src=play.swf?file=file2.mp3>
> ....
>
> by the way, i want each song to be incremented (+1 hit) in the database
> when i play it.
> so i used a lure in list.php :
>
> Artist #1 -
> <?
> if(!$file || $file!=$mp3) print "<a
> href='list.php?file=$mp3#artiste1'><img
> src='play.jpg'></a>";
> elseif($file && $file==$mp3)
> {
> the mysql query : update table set hit='hit+1' WHERE mp3='$mp3
> print "<embed src=play.swf?file=".$mp3."&autoStart=true...>";
> }
> ?>
>
> that's not very "pro" ...
> to skip this lure, i know there is a way to send the song ID to the "Flash
> single mp3 player", then increment it from swf and play it.
>
> i started with a
> <embed src='play.swf?ID=74...'>
> i suppose i have to send ID var to a php script called from Flash. Then
> increment the song in the php, get the mp3 url, send it to Flash and
> finally play it... im too noob at Flash/actionscript, i spent a lot of time
> searching and testing scripts, in vain ;(
>
> Can someone help me please ?
> thanks for all