January 6th, 2005, 12:37 PM
|
#1 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Sweden
Posts: 1,708
| ASP/JavaScript/Database etc...
Have to write an administration tool to add, remove and edit items in a database, in ASP. The database is Access (were it up to me I'd use PHP and MySQL, but it isn't so...). How would you go about this? I haven't written ASP in two years, so I'm a little rusty. I have done something similar before, and am digging around the code in that to see if adaptation is possible. Any suggestions about how each row would be put out? I'd like it to be simple to use and to have the option of deleting several items at once.
Also, how would you implement a JavaScript popup with an image on each item from the database. I have the image path in a database field for each item. |
| |
January 6th, 2005, 12:47 PM
|
#2 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,549
|
This should iterate through everything
sSQL = "SQL STATEMENT"
set oRS = oConn.execute(sSQL)
while(not oRS.EOF)
'Iterating though each row
Respose.Write "Crap you want, " & oRS("field")
oRS.MoveNext
wend
Add is easy, make a form, post it to an add page and use the appropriate insert statement.
Edit, load it into a form using value="" to fill in the blanks, repost it onto the edit page and use Update.
Remove add a yes/no dropdown after each one with a value of the records id, or some other unique identifier. Give them all the same name and you will be left with name=valoue, value, value
Do a split and iterate through the resulting array with delete statements.
Jkrohn |
| |
January 10th, 2005, 03:00 AM
|
#3 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Sweden
Posts: 1,708
|
Right, the code for the "CMS" is coming together, although there are some issues.
I need to use a DSN-less connection for the database, meaning it will reside in the wwwroot , meaning I need a way of making it at least somewhat secure. I need a password somewhere, for the admin stuff. What is less bad, putting the pw in the code itself or loading it from the db? Loading it from the db would be worse, from what I can understand. Is there some way to envrypt the pw if it resides in the ASP code? How do I solve the security issues? Once again, I wish the host had at least SQL Server instead...
Also, haven't been able to straighten out the permissions so the db can be updated yet. But this is something I'll look into during the morning. I'm sorry if I type in a confusing way, I just got out of bed. |
| |
January 10th, 2005, 05:34 PM
|
#4 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Sweden
Posts: 1,708
|
Right, so my main concern right now is the password bit.
If I understand it correctly, ASP has no built-in function for encrypting passwords using MD5 or similar.
Right now, my admin page is pw protected, but not in a secure way at all.
Suggestions, please.
/AE |
| |
January 10th, 2005, 05:40 PM
|
#5 (permalink)
| | Ultimate Member
Join Date: Jan 2003 Location: MA / NH
Posts: 1,497
| |
| |
January 14th, 2005, 04:34 AM
|
#6 (permalink)
| | Ultimate Member
Join Date: Oct 2001 Location: Sweden
Posts: 1,708
|
Blaze, I'm sorry I'm an amateur and integrating an encryption algoritm into ASP is beyond my abilities. There must be another solution for the whole password protection thing.
I mean the system I have now does work, but having the password in the script source feels less than perfectly secure, even if the server is setup right and doesn't allow for viewing script sources. |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |