For a number of weeks now I've been attempting to complete this task, however I'm having major issues in doing so - any help will be greatly appreciated!
The issue I'm having lies with Client-Side Programming. Given I usually concentrate on server-side code like PHP, front-end clearly isn't my forte.
I have a form (just a simple one: Name, Shift, Comment) built with nothing fancy, just HTML and CSS. I need to store data submitted using this form in a .txt file, that can be read back. This 'website' (term used loosely!) has been created on an external drive, and therefore has no PHP or ASP permissions.
I've tried the ActiveXObject approach; no luck.
I've tried the FileSystem method; no luck.
The browser used is IE7 and it isn't possible to use anything else.
I assume that if possible, I'll have to use Javascript to do this, as I'm unaware of any other language that could possibly be used. jQuery or any other plugin isn't available to use on the system.
Again, any help; greatly appreciated! Thanks a lot!
Though it may not be possible, you need to re-evaluate project requirements. JavaScript can't do it, b/c you need to access the file I/O, & that is only possible with a compiled language such as .NET, or as you mentioned PHP.
Could you send the data to an external (or internal) PHP web page or script on a server that has PHP permissions? If so, you could output as a txt file there.
I suspect that the "action" parameter of a form supports absolute addressing. If so, that may be your only solution.
Though it may not be possible, you need to re-evaluate project requirements. JavaScript can't do it, b/c you need to access the file I/O, & that is only possible with a compiled language such as .NET, or as you mentioned PHP.
I thought as much. I refuse, however, to believe that nobody on the entire web has come up with a solution to an issue that must have arisen before.. Somewhere!
Originally Posted by jedaisoul
Could you send the data to an external (or internal) PHP web page or script on a server that has PHP permissions? If so, you could output as a txt file there.
I suspect that the "action" parameter of a form supports absolute addressing. If so, that may be your only solution.
Although this would be a great idea, I'm I'm afraid not.
Could you please expand on what you mean by 'absolute addressing'? If you're asking if the 'action' parameter directs to another page, no it doesn't - a button is used below the form that runs JS via onClick.
I thought as much. I refuse, however, to believe that nobody on the entire web has come up with a solution to an issue that must have arisen before.. Somewhere!
Using JavaScript to write to a I/O directory is not an option. It would have security holes all around it, not to mention, if anyone decides to turn off JavaScript, your solution is defunct. Why can't you use LAMP on this external hard drive? To me, LAMP running locally is really the only viable option. If you use LAMP locally on this hard drive, and give the directory you want to write to full permissions, you should be fine.
Using JavaScript to write to a I/O directory is not an option. It would have security holes all around it, not to mention, if anyone decides to turn off JavaScript, your solution is defunct. Why can't you use LAMP on this external hard drive? To me, LAMP running locally is really the only viable option. If you use LAMP locally on this hard drive, and give the directory you want to write to full permissions, you should be fine.
Nobody will turn JavaScript off, and if they do, they're shooting only themselves in the foot.
I can't use any sort of server-side code on this system. It simply isn't an option. Unfortunately, I may have to give up on this idea, and simply turn the form into a MAILTO option. Shame.
Thank you for all your help though, both of you. Greatly appreciated.
Nobody will turn JavaScript off, and if they do, they're shooting only themselves in the foot.
LOL, bad assumption to make. I can remember a particular someone (surely not me) having that exact same premise. My point was, relying on JavaScript for this is not the right idea or path. Hope you get it figured out.
Although this would be a great idea, I'm I'm afraid not.
Could you please expand on what you mean by 'absolute addressing'? If you're asking if the 'action' parameter directs to another page, no it doesn't - a button is used below the form that runs JS via onClick.
Abolute adressing is where you give the full URL of the web page or script that is to process the form input. E.g. Assuming there is a php script called "textdump.php" in public_html on a site called "mysite.com", then (using absolute addressing) the form command should be something like:
I've just tested it by submitting a form input from my local development site to my live site and it worked. The live script received the post, converted it to an email which it sent to my email account with hotmail. It also logged it to a text file. So you can even have email notifications if you wish. All written in PHP and HTML.
hey, why dont you give a try to HTA (HTML Applications). you can get the job done with JScript via FileSystemObject. actually writing directly to users' files system is not allowed in browsers due to security on the web. however you can use HTA as it runs as an application rather than a webpage thus has more power.
Bookmarks