Be the first to write a review
FREE! Building A File Upload and Rating Application Support
Following on from his free tutorial on building a Content Management System with Server Behaviours and the Advanced HTML Editor, Matt shows how build a site that allows users to upload their own files, and rate those files. There's also a password-protected moderator's area so that you can be sure that all files can be checked before being made "live".
This free tutorial is suitable for beginners and uses only built-in Dreamweaver server behaviors and the DMXzone Pure ASP/ ASP.NET Upload Extensions! The uploading element is also PHP compatible, but the "rating" system doesn't work with PHP since it has no Command behavior to do the rating with.
Building uploaderlogin.asp
Uploader login is where anybody who tries to access the restricted pages gets booted to. If you're using the previous article's news pages, you may wish to combine everything under one login.
Add a form to the page containing two text inputs and a submit button. Name the text inputs username and password, and set the 2nd one to the password type so that it echoes asterisks rather than the actual password. Rename the form to validate. The page should look something like this:
You may wish to add some text saying "you are not logged in, to log
in use the form below:"
Go to the Server Behaviors panel. Select + > User Authentication > Login In User. A dialog box will pop up:
The behavior should automatically detect which form fields to grab the login information from, but if not, make sure the username and password are the right way round.
We choose our database to validate the user against, the database table in which the user data is held (cms_users) and the columns for the username (cms_user) and password (cms_pass). Again, make sure the dropdowns are set to the correct column. We also set the pages to go to if we succeed (uploaderadmin.asp) or fail (login.asp). Click OK to close the dialog.
The login page is now finished, so you can close that as well.
Finishing Off
So, after finishing all the pages, you should upload the files you created and the Scriptlibrary files to your testing server. You should now have a working file rating application. Easy, huh?
Matt Machell
A man of many talents, Matt has been a web designer, technical editor, and jewellery picker. He is currently on contract for the Birmingham City University, producing pages for research centres.
He has tech-edited a dozen books on web design and development for glasshaus, Apress and Sitepoint.
He likes music with loud guitars and games with obscure rules.
His website can be found at: http://www.eclecticdreams.com
He lives in Birmingham with his girlfriend, Frances, and a horde of spider plants.