[PHP-DB] Re: test
Be welcome. song wrote: > new comer from China > > test -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] flash/php problem
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 - Artist #2 - 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 "src='play.jpg'>"; elseif($file && $file==$mp3) { the mysql query : update table set hit='hit+1' WHERE mp3='$mp3 print ""; } ?> 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 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
Why not have a play.php which does this: 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 - > Artist #2 - > > > 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 " src='play.jpg'>"; > elseif($file && $file==$mp3) > { > the mysql query : update table set hit='hit+1' WHERE mp3='$mp3 > print ""; > } > ?> > > 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 > > 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
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: 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 - Artist #2 - 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 "href='list.php?file=$mp3#artiste1'> src='play.jpg'>"; elseif($file && $file==$mp3) { the mysql query : update table set hit='hit+1' WHERE mp3='$mp3 print ""; } ?> 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 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
[PHP-DB] Renaming a table once it has been created
Is there a way to re-name a table once you have created it? Ron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Renaming a table once it has been created
Ron Piggott (PHP) wrote: Is there a way to re-name a table once you have created it? Ron Depending on the type of DB some sort of ALTER TABLE statement I imagine, not sure what this has to do with PHP though... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Renaming a table once it has been created
Ron Piggott (PHP) wrote: Is there a way to re-name a table once you have created it? Ron ALTER TABLE `old_name` RENAME `new_name` Jeffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Passwords
Hi, I have created a user login/registration page. As of now I am using a MySQL database to store the info of the user. To validate the user I also have the password stored in the same DB. I was wondering if there is a way that I can store the password in the DB so that it is encrypted or something. Just so it is not in plain text. Ben -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Passwords
I have created a user login/registration page. As of now I am using a MySQL database to store the info of the user. To validate the user I also have the password stored in the same DB. I was wondering if there is a way that I can store the password in the DB so that it is encrypted or something. Just so it is not in plain text. Of course. Check out any of MySQL's encryption functions. Make sure that you use the same function and parameters for both the registration and the login or else the login will never work. Larry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Passwords
I tend to use a hash value (like MD5) to one way encrypt it... If you combine it with a salt value (some random string that is consistent in the app) then is reasonably secure from being hacked...ex. $salt = '1234567890'; $pass = md5($salt.$_POST['password']); bastien From: Benjamin Stambaugh <[EMAIL PROTECTED]> To: "php-db@lists.php.net" Subject: [PHP-DB] Passwords Date: Wed, 08 Mar 2006 18:34:25 -0500 Hi, I have created a user login/registration page. As of now I am using a MySQL database to store the info of the user. To validate the user I also have the password stored in the same DB. I was wondering if there is a way that I can store the password in the DB so that it is encrypted or something. Just so it is not in plain text. Ben -- 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
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: 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=74&URL=yourmama.com&TITLE=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
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: > > > > 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=74&URL=yourmama.com&TITLE=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
Re: [PHP-DB] flash/php problem
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: 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: 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=74&URL=yourmama.com&TITLE=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
Re: [PHP-DB] flash/php problem
how can i update my DB through Flash, using PHP. The easy way... Flash: var info:String = "YoMama"; var id:Number = 12; getURL("http://myserver.com/my_db_update_page.php";, "_self", "GET"); PHP [my_db_update_page.php]: This won't tell you if there has been an error during the update. If you need confirmation use AMFPHP. Tony -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] flash/php problem
On second thoughts you probably better off with load variables. Flash: var info:String = "YoMama"; var id:Number = 12; loadVariables("http://myserver.com/my_db_update_page.php?id="+id+"&info="+info+"";, this); PHP [my_db_update_page.php]: The function for checking the result is in the flash manual: Actionscript Language Reference >> loadVariables() Tony -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] flash/php problem
query("update hitcounter set plays = plays+1 where file = {$_GET['file']}"); header("Location: play.swf?file={$_GET['file']}"); Sorry I didn't read this thread thoroughly enough. This looks like a good solution to me. You just need to have the swf make the request and return the mp3 to the swf not a reference to another swf. query("update hitcounter set plays = plays+1 where file = {$_GET['file']}"); if (!error) header("Location: {$_GET['file']}.mp3"); Tony -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php