I have a webserver, and a webpage can show me the current temperature values from EMX. The temperature values are loaded into a data.txt file for my web-server to serve. via AJAX-xmlhttprequest or jquery method this data.txt file could be updated every 5 seconds, then, corresponding with the update of my temperature-output web page.(see picture 1). the yellow field show me the current temperature values, the values are refreshed every 5 seconds.
Beside reading the parameter from EMX to webpage, I want to write parameter from webpage to EMX too. I want to define a parameter field(parameter table) on this webpage (see picture 1), if I click or double click the value of parameter, I can change the value of the parameter and the changed value can be transformed to EMX. Can you give me some suggestion, how can I realize my thinking?
I have thought about your suggestion and I want to realize my frist step: writing somthing from forms to a text file.
After trying some times, I find a problem. If I do some thing about writing from forms to text file, I need use the php file.
but I don’t know how to retrieve the php file. It seems that I need a content type for php file
php is a server side technology. It needs to have support and PHP processor on the web server. Serving a php file back to a client as a content serves nothing.
Similar to what you already have. In you form html page you provide a new action to a virtual page/url.
In the event handler for that virtual page/url you will need to check Request object to get to the Form fields with values and save them to your txt file.
I have tried many times and read many examples, I find if I want to write something from form to a text file, I must use the php file. but as you told me, my webserve doesn’t support the php.
I feel despair,… where is the right way to resolve my thinking.
I still don’t understand how to write something from form to a text file avoid php. please some help…
PHP is an interpreter that runs on the “Server”. In your case, your server netmf code will be doing the same job.
Do you have a form that you can POST data with? That’s the first step.
If you then look at the data submitted in a form POST (debug it), you’ll see the data you want. You then just need to extract that and then do whatever you want to it in your app - including send it to a text file.
I really don’t know how can I get the content of the 2 form and write them to a txt file. The most online examples is about writing to txt file with php.
As picture showed, if I give a form a value and click the buttom, the value will be written in txt file. then I want to access the txt file and get the value for my C# threadloop.
Your write_value_to_text_file is just a piece of js code that supposed to run on a client. You still need to make GET or POST request back to the server and pass the values from the input boxes.
As an exercise for you. Try to answer as fully as possible to this question: What is the difference between GET and POST http requests.
No, you should be able to have a better answer. Think of the parts the generic HTTP request and response consist of in a raw form and then see the differences between GET and POST. Understanding of these concepts is crucial if you want to be successful in what you are doing.
I have read a lot of online examples, all examples about submitting form content to a text file need the help of php file. I have also tried any the AJAX and jquery examples, they also need the php file.
I can’t use the php file in my Webserver, I have tried all online examples, the php files of these examples don’t work in my webserver.
Can you give me a example about submitting form content to a text file without php file?