Current location: Hot Scripts Forums » Programming Languages » PHP » Music Player Generator

Music Player Generator

Reply
  #1 (permalink)  
Old 12-12-07, 01:17 PM
mckucheto mckucheto is offline
Newbie Coder
 
Join Date: Dec 2007
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Music Player Generator

I just created a functional generator, that generates the embed code for a custom "Flash Mp3 Player". Three files are used: 1 HTML, and 2 PHP, and they're hosted in a writable (CH MOD 777) folder, on a Linux server. The "Index.html" has an actual XML playlist in the form that can be edited by the user. Once the user submits that, it goes to "prot01.php", which writes it to a file on the server, with a unique name (i.e., 12-m2512-e12th) that has the date and minute in it. And then, that same filename is sent to "prot02.php", where it's displayed in the embed code. I'm still new to writing in PHP, and would like to know some ways that I can improve the function of this generator. It has a 2% failure rate as it is right now. Feel free to test it on my site.

index.html

Code:
<p align="center">
<form name="form1" method="post" action="prot01.php">
<TEXTAREA NAME=usertxt COLS=60 ROWS=20>
<?xml version="1.0" encoding="UTF-8"?>
<player showDisplay="yes" showPlaylist="yes" autoStart="no">
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 01"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 02"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 03"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 04"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 05"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 06"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 07"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 08"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 09"/>
<song path="http://realbadinc.com/123/sample1.mp3" title="Sample - Track 10"/>
</player>
</TEXTAREA>
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>



prot01.php

PHP Code:
<?
$fp
=fopen(date("m\-\min\-\ejS"), "w");
fwrite($fp,stripslashes($usertxt));
fclose($fp);
Header("location: prot02.php");
exit();
?>


prot02.php

Code:
<center>
<b><font color="red">Fubar (and other) Code</font></b>
<br />
<form name="test">
<br />
<textarea name="textarea1" cols=40 rows=7 onClick="this.focus();this.select()">
<embed allowscriptaccess="never" allownetworking="internal" src="http://www.realbadinc.com/players/mp3playerDevilgirl.swf" align="baseline" border="0" width="300" height="320" enablejavascript="false" menu="false" quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="playList=http://www.realbadinc.com/ip/generator/<?echo date("m\-\min\-\ejS");?>&ShowEQ=1&initVol=100" wmode="transparent"></embed>
</textarea></form>
</center>
<br />
<br />
<center>
<b><font color="red">Myspace Code</font></b>
<br>
<form name="test">
<br />
<textarea name="textarea1" cols=40 rows=7 onClick="this.focus();this.select()">
<object type="application/x-shockwave-flash" allowScriptAccess="never" allowNetworking="internal" height="320" width="300" data="http://www.realbadinc.com/players/mp3playerDevilgirl.swf"><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><param name="movie" value="http://www.realbadinc.com/players/mp3playerDevilgirl.swf" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="flashvars" value="playList=http://www.realbadinc.com/ip/generator/<?echo date("m\-\min\-\ejS");?>&ShowPlaylist=1&ShowEQ=1&firstTrack=1&initVol=100" /><param name="wmode" value="transparent" /></object>
</textarea></form>
</center>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any Creative ideas? whole-site music player (I.e. No refreshes) sp1ky HTML/XHTML/XML 0 08-27-06 12:35 PM
Mp3 Player Generator unlisted80 Job Offers & Assistance 1 08-10-06 09:48 AM
A mini music player on top page iKwak HTML/XHTML/XML 1 06-06-05 11:24 PM
Music Player dwoody JavaScript 2 12-06-04 01:42 PM
swf music player for web page? xxrockstarxx_1 Script Requests 2 09-13-03 05:10 PM


All times are GMT -5. The time now is 09:10 AM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.