tags:

views:

34

answers:

3

hi all,

I'm trying to understand some of the basics of web servers/html/javasacript etc. I'm not interested in any of the various frameworks like php/asp, i'm just trying to get a low level look at things (for now).

At the moment I'm trying to understand how data can be sent to/saved on the backend, but i must admit that i'm getting a bit lost under the various specs/technical stuff on w3 at the moment!

If I have some data, say xml, that I want to save on the backend how do I go about it?

I assume that I would have to use something like an HTTP PUT or POST Request to an html doc that contains some javascript that in turn would process the data, e.g. save it somewhere. Now from googling around I can see that this doesn't seem to be the case, so my assumptions are completely wrong!

So how is it done? Can it be done, or do I have to use something like php or asp?

TIA.

bg

A: 

The client (i.e. the browser) sends data to the webserver. A program on the webserver should store this data to a file. This program can be a PHP or ASP script, or a webserver plugin.

Sjoerd
A: 

Bear in mind that JavaScript is a client-side process, which means that whatever JavaScript does doesn't affect the server at all. You can use JavaScript in conjunction with a server-side language such as PHP or ASP to make the server do something other than serving the site, but that's about it in the context of what you're asking. Saving XML on the backend requires server-side action (processed by a language such as PHP or ASP but it can be invoked by JavaScript or by an HTTP (GET/POST) request).

I understand from your post that you're just trying to get a basic idea of what's out there, but in the long run, what would you like to accomplish?

I suggest that you read a tutorial on JavaScript and/or a server-side scripting language such as PHP or ASP. Once you get started, you'll get a better feel of what's going on.

Jan Kuboschek
A: 

I assume that I would have to use something like an HTTP PUT or POST Request to an html doc that contains some javascript that in turn would process the data, e.g. save it somewhere.

That is not entirely correct. You would need to use HTTP POST to send the data to the web server, but at that point you need some server-side script to process the file data that is being sent and do something with it. Javascript is a client-side language that runs on the users browser and not on the server.

See http://www.cs.tut.fi/~jkorpela/forms/file.html for a good explanation of how file upload works from both an HTTP perspective and some techniques to process the data server side.

Sijin
ok thats interesting. I assumed - wrongly - that javascript would work on the back end. what was used before php et al.
CGI - http://www.w3.org/CGI/ also see http://www.garshol.priv.no/download/text/http-tut.html
Sijin