Exporting from forms as text
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Exporting from forms as text

  1. #1
    Senior Member
    Join Date
    Mar 2002
    Posts
    442

    Exporting from forms as text

    I have been looking around quite a bit on how to do this, but I have been unable to find anyway to do this. I need to set up some kind of web based <FORM> tag, or some simple javascript, (can NOT use any type of SQL database, cgi-bin, additional host et cetera) that can export the <INPUT>'s from within it to a plain text file or something similar saved onto the web server.

    As an example, I need a <FORM> (or javascript, or something similar) that has a number of choices, and fill in the blanks, that when submitted, will save the results using something similar to ENCTYPE="text/plain" to a file on the web server.
    (Anonymous access, without logging in or setting up any type of account before hand, is also required)

    Using e-mail is not an option, using the cgi-bin of the web server is not an option, php is not an option, and having to set up an additional server or services of any kind is not an option.

    I do have full administrative access to the web server, however as previously said, changing just about anything is not an option.

    I am not sure if this is possible but hopefully one of my fellow AO'ers will be able to assist me in this problem.

    Again, any help is greatly appreciated.

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,914
    Hey Hey,

    I think I follow what you are saying. Do you have Server Side Includes, could you possibly use the SSI exec command to echo the variables out to a text file? If not could you do some jS? Check out the information @ http://www.faqts.com/knowledge_base/...id/5785/fid/53 for writing variables to a document. Using that and some simple variable passing you should beable to pull off what you want..

    peace
    HT
    IT Blog: .:Computer Defense:.
    PnCHd (Pronounced Pinched): Acronym - Point 'n Click Hacked. As in: "That website was pinched" or "The skiddie pinched my computer because I forgot to patch".

  3. #3
    Member
    Join Date
    Dec 2003
    Posts
    59

  4. #4
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    The3ntropy - With _NO_ cgi-bin or any server-side processing? I don't think that is possible.

    You will need something server side to recieve it. The <FORM NAME="MyInput" TARGET="get.php"> tag needs a target on the webserver that can take it and save it to a file. Otherwise, it simply isn't possible to put it on the server with only client side, as far as I'm aware.


    HTRegz - that appears to be client-side and wouldn't do anything for the webpage on the server. I have some ActiveX code for IE that saves files, but again that is client-side and will not make a file on the webserver. Although SSI is possible, 3ntropy said to use nothing serverside and I'm sure that it isn't possible in that case...

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    442
    Sorry for not stating it early, I thought that it would be assumed, no server side includes. Like I said from before, there cannot be the need to change, or add any serverices to the web server.

    I need the server to be able to accept the form's input results and be able to save (or append) them to a plain text file or any file for that matter on it's side (server side). I was hoping to do something similar to allowing guest access to a folder, limit it's maximum size, and be able to somehow target the output of the form to a file(s) within that folder.

    I would greatly appreciate it if anyone would be able to show or instruct me how to do this. Please and thank you; as usual.

  6. #6
    Antionline Herpetologist
    Join Date
    Aug 2001
    Posts
    1,165
    I don't think this is possible at all. AFAIK, to write anything to the server, you need to be able to use some kind of server side code. One thing that I can think of, is using some kind of server vulnerability to write your files. Otherwise, it *shouldn't* be possible.
    Cheers,
    cgkanchi
    Buy the Snakes of India book, support research and education (sorry the website has been discontinued)
    My blog: http://biology000.blogspot.com

  7. #7
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    The3ntropy - You can't just expect Apache or IIS to know what to do with the input. All the web server is there for is serving up files via HTTP.

    That being said, you will need some server side code, ie PHP, ASP, SSI, CGI-BIN (PERL, C/C++, etc) to take the input, and save it into a file. Of course from there securing it is important - you don't want them to be able to save or overwrite any file on the web server machine through it.

    Otherwise all of the suggestions so far here would save the file on the client's computer, which is what the JavaScript would do. You will need something on the server's end to collect the information, which is what the PHP/ASP/PERL/Anythingelse can be used to do. Checkout hotscripts.com and they have a ton of scripts and some might do what you want.


    But if you don't want to use any scripts...you won't be able to have them acturally submit the information (form) and have the information recorded. The web server would simply drop it all, which would get you nowhere. So if you simply cannot use any server-side scripting...there really isn't much you can do...


    Although... If you wanted to be creative, you could use Javascript to create a URL in a directory that doesn't exist. The URL would be like "www.mysite.com/entropy/err/username/option1-t/option2-f..." and since it doesn't exist, it would show up in the error logs, and hopefully the URL is included in the log and you can decipher the data. The problem is URLs are limited to 255 characters or so by the HTTP protocol. So if they type too much you're out of luck... But that is stretching it...



    Edit - cgkanchi beat me...

  8. #8
    Senior Member
    Join Date
    Mar 2002
    Posts
    442
    I was hoping that there would be someway to set up an open directory with write only permissions to all or tell the webserver to allow write permissions to a folder that it is hosting, then telling the javascript to output the file to that folder.

    The error log idea is a nifty one, but due to the expected volume of users to be sending in the form it would not be reasonable.

    Isn't there anyway to just have javascript save the file locally, then copy or send it to a web directory that has write permissions granted to all ?

  9. #9
    Senior Member
    Join Date
    Mar 2002
    Posts
    442
    F

    *sigh*. . .oh well, thanks for the help everyone.

  10. #10
    Ninja Code Monkey
    Join Date
    Nov 2001
    Location
    Washington State
    Posts
    1,027
    While it's a clunky process you may just want to give them a standard text/doc/whatever file to download and fill out....then have them save it to the server with a 'file' input.
    "When I get a little money I buy books; and if any is left I buy food and clothes." - Erasmus
    "There is no programming language, no matter how structured, that will prevent programmers from writing bad programs." - L. Flon
    "Mischief my ass, you are an unethical moron." - chsh
    Blog of X

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •