Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Databasing
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 03-21-2008, 02:16 PM
  #1
ragha81
Novice (Level 1)
 
Join Date: Mar 2008
Posts: 1
iTrader: (0)
ragha81 is an unknown quantity at this point
click on a link should download a file

I need to create a link on my company's website. Once the users click the link, it should download an excel file.

the file is dynamic and it should change according to the person that logs in.. I am new to html. can you guys provide me ideas to do this...

Thanks
Ragha
ragha81 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-21-2008, 02:32 PM
  #2
Pegasus
The Flighty Admin
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 17,921
iTrader: (0)
Pegasus is a jewel in the roughPegasus is a jewel in the roughPegasus is a jewel in the rough
You should only need to put the file address in and it will download - <a href="file.xls">Excel File</a>

Getting it to download to match a particular person, however, will require a database and login script. It can't be done with HTML.

Comments on this post
da_hustler17 agrees:
__________________


Decaf is the root of all evil...
HTMLForums Awards - The Winners Are...
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-22-2008, 12:41 PM
  #3
da_hustler17
Soldier (Level 11)
 
da_hustler17's Avatar
 
Join Date: Feb 2008
Location: Next To You
Posts: 107
iTrader: (0)
da_hustler17 is on a distinguished road
Quote:
Originally Posted by Pegasus View Post
You should only need to put the file address in and it will download - <a href="file.xls">Excel File</a>

Getting it to download to match a particular person, however, will require a database and login script. It can't be done with HTML.
I agree!!! I still dont understand the database part.. Can you elaborate?
__________________
Im getting pretty good at coding. Still needs help though... We all Do.
Quote:
That's why it is great to gives thank's to the ones that helped you when you didn't know how..So you may be able to bless others in the near future with the same knowledge....

da_hustler17
da_hustler17 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-22-2008, 12:52 PM
  #4
Pegasus
The Flighty Admin
 
Pegasus's Avatar
 
Join Date: Nov 2001
Location: 35º South of Santa Claus
Posts: 17,921
iTrader: (0)
Pegasus is a jewel in the roughPegasus is a jewel in the roughPegasus is a jewel in the rough
You'll need to have a database that stores the login information and matches the pages/downloads to the user. I'll move this thread over to the Databasing forum and someone there will know exactly what you need.
__________________


Decaf is the root of all evil...
HTMLForums Awards - The Winners Are...
Pegasus is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-23-2008, 02:07 AM
  #5
da_hustler17
Soldier (Level 11)
 
da_hustler17's Avatar
 
Join Date: Feb 2008
Location: Next To You
Posts: 107
iTrader: (0)
da_hustler17 is on a distinguished road
Unhappy

Sorry, Ragha81

Didnt wanna start another thread when this one is about the same thing!
Im currently working on a site... But, im stuck. Let me explain.

I want to have people upload there own mp3's; and be able to download others!
My site is not published because of that reasons.. Any help would greatly be appreciated.
__________________
Im getting pretty good at coding. Still needs help though... We all Do.
Quote:
That's why it is great to gives thank's to the ones that helped you when you didn't know how..So you may be able to bless others in the near future with the same knowledge....

da_hustler17
da_hustler17 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-24-2008, 02:11 PM
  #6
putts
Don't call it a comeback.
 
putts's Avatar
 
Join Date: Nov 2002
Location: Frankenmuth, MI
Posts: 4,723
iTrader: (0)
putts will become famous soon enoughputts will become famous soon enough
da_hustler......how far have you made it on your site?

do you have some tables set up to store user/mp3 information?
are you wondering how to set that up?
something totally different?

need some background to help get you going
__________________


Dont like my signature image? Click it to change it
putts is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-24-2008, 08:35 PM
  #7
da_hustler17
Soldier (Level 11)
 
da_hustler17's Avatar
 
Join Date: Feb 2008
Location: Next To You
Posts: 107
iTrader: (0)
da_hustler17 is on a distinguished road
Question

Putts... Im planning on add the forms and everything else as soon as i understand the databasing part. But here's what i got so far..
Code:
<form action="http://yourdomain.com/Your Directory/Audio/" method="post" encType="multipart/form-data" /> 
<input type="hidden" name="Max_File_Size" value="500" class="file" />
<input type="file" />
<br> 
<input type="submit" value="Upload">
</br>
</form>
But I dont know how to validate the the script.. any help?
__________________
Im getting pretty good at coding. Still needs help though... We all Do.
Quote:
That's why it is great to gives thank's to the ones that helped you when you didn't know how..So you may be able to bless others in the near future with the same knowledge....

da_hustler17
da_hustler17 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-25-2008, 09:15 AM
  #8
putts
Don't call it a comeback.
 
putts's Avatar
 
Join Date: Nov 2002
Location: Frankenmuth, MI
Posts: 4,723
iTrader: (0)
putts will become famous soon enoughputts will become famous soon enough
Okay....so you have no database layout at all so far?

In that case, you'll want to do it a piece at a time. Hopefully by the time you're past piece 1 or 2 then you'll have a better idea of the what exact questions you'll need to ask.

First, start with the registration piece. You'll need one of these to get your users set up so it's a sure-fire necessity and thus one of the best places to start.

You'll need to figure out what information you want to store in your Users table and then translate those into columns.

For instance, you'll need User Name, Password, Email and probably First Name and Last Name so let's mock that up.

Code:
CREATE TABLE USERS
(   ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
    USER_NAME varchar(25) NOT NULL DEFAULT '',
    PASSWORD varchar(25) NOT NULL DEFAULT '',
    FIRST_NAME varchar(150) NOT NULL DEFAULT '',
    LAST_NAME varchar(200) NOT NULL DEFAULT ''  )
(this is written for a MS SQL Server database.....if you're using mySQL then you will want to research the correct syntax for that. Or, you can always use the GUI Front end for your Database to create the tables)

What we have there is an ID which will just be an increment integer value (1,2,3,4.......). When referring to users from other tables, you'll want to use this.....Integer-based searches are much faster than character-based. Storing the value '1' 1000 times is also much better on your storage than storing 'guest'.
The following columns are all pretty straight forward. One thing you might not notice in other people's examples on the web is that I force all my columns to be NOT NULL and supply a default value of '' (empty string). A very often overlooked performance tweak to any database is to not ever use NULLs when you can get around them. They cause overhead and for almost all varchar fields, the empty string works just as good.

Okay, so we have your users table.....let's whip up another sample table so you can see how we use that ID field from the USERS table and I can show you how to use a View to pull the information all together.

Let's say you want a separate table to store users' avatars.

Code:
CREATE TABLE AVATARS
(    ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
     AVATAR_FILE_NAME varchar(500) NOT NULL DEFAULT '',
     USER_ID INT NOT NULL DEFAULT 0  )
So, if we had the following user entries....
Code:
ID   USER_NAME    PASSWORD   FIRST_NAME   LAST_NAME
1      rthomas         ******          Rob             Thomas
2      bspears            ****         Brittney          Spears
....then we could expect to see Avatar rows like this....
Code:
ID        AVATAR_FILE_NAME      USER_ID
1        c:\I_am_washed_up.jpg       2
2         c:\I_am_awesome.jpg         1
You should be able to use those USER_ID values to figure out whose Avatar is whose.

And...now that I think of it...there's a sticky in the Database section here that I think has a guide to Views that I wrote....check it out to see how to tie those tables together into one query.
__________________


Dont like my signature image? Click it to change it
putts is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-29-2008, 03:14 PM
  #9
da_hustler17
Soldier (Level 11)
 
da_hustler17's Avatar
 
Join Date: Feb 2008
Location: Next To You
Posts: 107
iTrader: (0)
da_hustler17 is on a distinguished road
??? i am now confused.

i dont have any MySQL knowledge im using simple html/css trying to learn php. im still in school for this.
__________________
Im getting pretty good at coding. Still needs help though... We all Do.
Quote:
That's why it is great to gives thank's to the ones that helped you when you didn't know how..So you may be able to bless others in the near future with the same knowledge....

da_hustler17
da_hustler17 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-29-2008, 04:46 PM
  #10
Vege
♥♥♥
 
Vege's Avatar
 
Join Date: Sep 2004
Location: Finland
Posts: 2,513
iTrader: (0)
Vege will become famous soon enough
for mysql:
This line needs to be changed in both sql create querys:
Quote:
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY
it needs to be
Quote:
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY
__________________

I hate u
Vege is online now   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 03-31-2008, 12:22 PM
  #11
putts
Don't call it a comeback.
 
putts's Avatar
 
Join Date: Nov 2002
Location: Frankenmuth, MI
Posts: 4,723
iTrader: (0)
putts will become famous soon enoughputts will become famous soon enough
da_hustler, find some tutorials online that are introductions to database, especially some geared toward mySQL.

We cannot hope to instruct you in all the ins and outs of databasing through a post like this. There's way too much there to learn and any attempt at it would probably leave you with just enough information to make you dangerous
__________________


Dont like my signature image? Click it to change it
putts is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 04-01-2008, 05:39 AM
  #12
da_hustler17
Soldier (Level 11)
 
da_hustler17's Avatar
 
Join Date: Feb 2008
Location: Next To You
Posts: 107
iTrader: (0)
da_hustler17 is on a distinguished road
Putts, I Agree!
__________________
Im getting pretty good at coding. Still needs help though... We all Do.
Quote:
That's why it is great to gives thank's to the ones that helped you when you didn't know how..So you may be able to bless others in the near future with the same knowledge....

da_hustler17
da_hustler17 is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply


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



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 11:10 AM.