Jump to content

Save to txt?


Recommended Posts

Im fairly new to javascript. Only been using the lanuage for about 2 months now and I seem to have ran into one of the first problems I have had in a while. Our school has shut down out PHP/MySQL Servers so I cant use them anymore. I was coding a CMS and now I have to translate my secure PHP scripts into unsecure Javascript. So heres my problem.

 

"Is there any possible way I can take data from a form and save it into a .txt document? And if there is how would I call that file back and have it displayed in the web browser? Please help I got about 4000 lines to translate and only 10 days till exams!

Link to comment
Share on other sites

not with javascript you have to use php to write to a text file since javascript is clientside(runs in the browser) and doesnt have access to your server

 

btw i think sqlite could be an answer for not having a db or xml

you can use either xml or sqlite as a flat database.

sqlite is a file you can store on the server

Link to comment
Share on other sites

wait do you mean you have no serverside language what so ever?

in that case you cant have any cms running on the server so your pretty much stuck.

as for ajax. ajax is nothing more then combining a serverside language(such as php) with javascript to update a page without refreshing

Link to comment
Share on other sites

javascript only validation is no good anyways - if the user turns off javascript, the page will submit with no validation at all. So you should always only use javascript validation in addition to server-side validation. Never by itself.

 

There are free hosts out there that have mysql databases and php. Try to find one of them.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.