Re: [PHP-DB] flash/php problem

2006-03-11 Thread Hoz

(sorry i'm late ;))
well it's all done and works perfectly

i send the mp3 ID to SWF, then update DB with PHP i call from SWF, return 
the mp3 file to SWF then play the file.

i cant show you the result, but it looks nice

really thank you all ! big up Tony ;)

Th.



- Original Message - 
From: Micah Stevens [EMAIL PROTECTED]

To: php-db@lists.php.net
Sent: Saturday, March 11, 2006 6:19 PM
Subject: Re: [PHP-DB] flash/php problem



On Friday 10 March 2006 6:24 pm, Anthony Lee wrote:

 Actually, I don't see why either method would work:

The SWF is in a static HTML page. It requests an mp3, and loads it 
without

having to refresh. So it needs an mp3 returned, not another SWF.

Updating the DB from the SWF call sounds cool, but serverside wise
requires the
.htaccess updated to instruct .swf requests from that dir to be read as
PHP. The PHP script would need to update the DB then open the mp3 and 
write

the correct headers before returning it.


In my example the PHP is not streaming the mp3 to the flash file, it's 
merely

passing on a URL. I think  you're really misunderstanding what I was
attempting to say. So you don't need to open any mp3 in the php file, nor
return any mp3 information.

Although, now that you bring it up, that would be one way to do it, but I
wouldn't because that would introduce a much larger system load.

Just call the php, and then the php calls the SWF. Simple as that.

-Micah



 What's the AMFPHP deal?

Flash Remoting. Action Message Format. Like SOAP but better :D

Tony


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] flash/php problem

2006-03-08 Thread Hoz

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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] flash/php problem

2006-03-08 Thread Hoz

i have to display the whole songs list in the same page.
the flash embed player is a customized button next to each song of the page.
header function has to be placed before any print/echo, or i'll get the 
traditional warning Cannot modify header information - headers already sent 
by ...


if i send the ID var of the selected song to Flash, it could be suitable.
(and the mp3 url won't be displayed in the html source)


- Original Message - 
From: Micah Stevens [EMAIL PROTECTED]

To: php-db@lists.php.net
Sent: Wednesday, March 08, 2006 4:18 PM
Subject: Re: [PHP-DB] flash/php problem




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


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] flash/php problem

2006-03-08 Thread Hoz

yep,
and the exact question is : how can i update my DB through Flash, using PHP.
Thanks Tony, amfphp looks interesting. i'll take a look.

but, Micah,
each song has to be played on its own flash player is the current list.php 
page.


quote --
list.php - this lists the mp3's, and each mp3 links to:
play.php?file=somemusic.mp3 - This increments the database and forwards to:
play.swf?file={$_GET['file']}
--

i dont want a new window in which SWF will be displayed, if it is what you 
mean.




Th.


- Original Message - 
From: Micah Stevens [EMAIL PROTECTED]

To: php-db@lists.php.net
Sent: Thursday, March 09, 2006 6:12 AM
Subject: Re: [PHP-DB] flash/php problem




Just an update to the DB on each swf load is what it seems he wants.

On Wednesday 08 March 2006 7:13 pm, Anthony Lee wrote:

This question isn't really a PHP-DB thang is it?

Anyway, it sounds like you have a lot of swfs on the page. One for each
song, is
that right? In that case your best bet would be something like what you
already
have:

embed src='play.swf?ID=74...'

i.e. push the variable into flash from the page that contains it. If you
only have a small amount of info the swf needs you can just keep on with
the theme

ID=74URL=yourmama.comTITLE=YoMama etc.

If you want to pull a lot more information from the DB after the page
has loaded
then you should take a look at PHPObject or AMFPHP. Hint, AMFPHP is a lot
more robust and faster.

And don't forget that you need to write the vars to a Param tag too.

Tony


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php