
JordanTLClive
Deleted
Oct 19, 2000, 10:44 AM
Post #4 of 5
(453 views)
|
Re: OK Writing CD Burner Script... output weird
[In reply to]
|
Can't Post
|
|
I DID IT! LOL. OK so if you didnt notice this is the first time I've written a script from scratch so Im quite excited. This is the working code..... <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> #! /usr/bin/perl push(@INC, "/cgi-bin/burner"); require("CGI-LIB.PL"); ######### # CD-R List Creator # This program takes the name of a file from a database to burn it ######### # This is the path to where datafiles will be kept $path = "/home/tlclive/tlclive-www/cgi-bin/burner/data"; # This is the extension of the file to create $ext = ".mpj"; &ReadParse(*input); @songs = split(/\0/,$input{'song'}); open (FILE,">$path$input{'name'}$ext"); foreach $i (0 .. $#songs){ print FILE $songs[$i]; print FILE "\nc:\\mp3\\"; print FILE $songs[$i]; print FILE ".mp3\n"; } print "Content-type: text/html\n\n"; print "<HTML><head><title> Thanks! </title></head><body>"; print qq~ Thank you for ordering a CD! You will now be directed to a page to pay for it. ~; print "</body>"; </pre><HR></BLOCKQUOTE> Now I have to fancy it up (it will create a form for a payment processing script) and make the html a bit nicer. The one thing I still would like to fix is if a file with that name exists, to ask the user to rename it....
|