#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    13
    Rep Power
    0

    Project help-how to save asp files in the db


    I am working on a project for my college and I need to add lessons to a system.

    Loading a complete lesson for my system is currently done by loading the text files from the database (which are currently stored as text lines)
    adding some exercises (I use templates I wrote that consist the buttons and all that is needed, and I only get the text for
    question and answers from teh database)

    All that is done by flags where to load what.
    It reads lesson text adds the templates for ex using the ex (questions and answers) text (from db) as needed.

    I was wondering how it should b done.
    Obviously my method is wrong.

    Maybe I could make it so the lessons files stored in the db are created by templates which combine the ex in them and are saved and loaded as whole in/from the db(so when I load them I dun load parts of the lesson and parts of the ex using flags but simply the lessons as is)
    and they will b saved as binary format so they use less space.

    the problem would only b with redirection which I will have to change cause the page wun exist untill created.
    it will b like loading the same page only with different output each time due to the user selection.

    I saw some examples on the net....ppl simply write asp pages. I could do that, obviously writing all manually calling for templates functions to add repeatitive structures is the easiest way I dun have to deal with db storing anything...

    Please tell me how u would do it :S
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    VBScript has Execute and Eval if you want to store the asp source in the DB and run it dynamically. You should carefully consider before using this method imho, there are lots of potential problems, like poor performance and security holes.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    13
    Rep Power
    0
    Thank you for the reply.
    I don't mind security holes since it is a project for school.
    I just thought what ppl usually do I mean woudln;t it b wierd if I had tones of pages just for lessons? (maybe not if kept in lesson folder).

    I am not trying to make things complicated but to keep them orgenized so I'd get a good grade.
    If keeping them as asp pages in a folder is ok I';d rather go with that but if it;s wierd and space taking and the instructors coming to test me would think it is just an outcome of laziness I wouldn;t wnat that >.<;
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    Visit some tutorials on database driven web applications which should give you an idea. Typically you'd have one set of code that would dynamically generate user pages from text data stored in the db.

    [[www.w3schools.com]] is one place to find some asp and database samples.
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo