Need help implementing a feature

Show off new creations, get help, or just chat about all aspects of web development and design.

Need help implementing a feature

Postby bobthehobo on Sun Sep 13, 2009 8:49 pm

I was wondering if any of you competent web designers would be able to solve this problem of mine. My friend and I have a business which has a semi-functioning website, and wanted to know if the following would be possible to implement and how it could be implemented (specifically), and if it would be on the difficult side or not.

Our company (Your Theory Music) is in a way, an online record label. Our artists record their music, and we get it out to the fans by giving out these wristbands with unique codes on them (6 digit numbers). Then they go to our website to redeem their code and download the music/video content.
Problem: I need a text field box (a big tumblr login style one would be great but not a requirement) where end users can type the code from their wristbands. The code must be a code that was in our database in order to work.

The user will go to the main page, then select the band they received the wristband from. Once on the band page, they will type their code in the text field box.

To make things easier the user will type in the band name initials to avoid programming problems. Example: let's say 76896 is used by both "timeout Jimmy and "the title". The user will be prompted to enter TOJ76896. All the codes in the database for timeout Jimmy will have TOJ before it.

If the code is correct, the user will be presented instantly with a unique download link either within the website (ideal) or through email. The code can only be used twice before becoming inactive.

We will host the files on our servers, and it would be best if we had the ability in the future to add codes once the database is set up.

If you have any ideas, please spill them.

THX
Image
Do the internet a favor: proof read your posts.
XBL: Doctor Fifer
User avatar
bobthehobo
Pheropod
Pheropod
 
Joined: Thu Sep 08, 2005 9:27 pm

Re: Need help implementing a feature

Postby BlekksPoncho on Sun Sep 13, 2009 10:12 pm

It seems like a pretty simple problem, just get all the codes in a table in your (I'm guessing MySQL) database with these fields: primary index, promotional code, band, usage and url. The primary index will be auto incrementing, the promotional code field is self explanatory, same for band, usage will start of as 0 and will count up to 2 when it's used and url will contain the url to the .mp3 or whatever.

I would use PHP for the promo code 'process' page, just checking that usage != 2, going to the download page and POSTing the url for the song once on the download page.

The only problem is, what's stopping someone getting 1 promo cide, downloading the .mp3 and then sharing it with all their friends? This completely undermines the point of the "only 2 downloads thing".

EDIT: I can do it for you if you want, I haven't got much else to do.

EDIT: Just realised that isn't all done online and uses some realzip thing so what I suggested can be ignored, and I've never heard of realzip so have no idea on your problem.
Last edited by BlekksPoncho on Sun Sep 13, 2009 10:19 pm, edited 1 time in total.
-----------------------
I'm not drunk, I always eat plastic.
User avatar
BlekksPoncho
Sir Post-a-lot
Sir Post-a-lot
 
Joined: Sat Apr 01, 2006 10:48 pm
Location: England - UK

Re: Need help implementing a feature

Postby zombie@computer on Sun Sep 13, 2009 10:14 pm

Just put the files in binary format in a sql table, then using a session, cookie (safer) or both to generate a (temorary) 'download slot', being the code+some unique (random) id and (you probably want to have) a timer to invalidate them again. Unfortunately there is no way to check if a user succesfully downloads a file, so a timer would be best imho.
The download link is basically a script that checks the credentials and produces the file from the table.

if you need help just google for 'mysql php file download' and 'secure login script php' or something.

What exactly is the problem anyway?
When you are up to your neck in shit, keep your head up high
User avatar
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Return to Web Design & Development

Who is online

Users browsing this forum: No registered users