-->
Page 1 of 3

Dynamic web pages?

PostPosted: Fri Jul 12, 2019 10:37 pm
by josephchrzempiec
Hello i only recently figure out how to add new webpages to the esp8266. But the question is it possible to dynamically create a webpage from the browser on the Esp8266? I have enough space i did upgrade my flash chip. So I was just wondering. A Friend of mine Hari he has a awesome youtube channel we had a talk and he said possibly able to do it but he wouldn't know how. So I'm asking the whole esp community if something like this can be done?


Joseph

Re: Dynamic web pages?

PostPosted: Sat Jul 13, 2019 8:34 am
by rudy
is it possible to dynamically create a webpage from the browser on the Esp8266?

I'm not sure what you mean. What I think you are asking is can the user use a webpage on the ESP8266 to create another webpage. Yes they can, but the next question is how to accomplish it.

The easy way is to give the user a text editor on the ESP8266, where they can type in the new webpage code, or edit some existing code. The fsbrowser.ino example has a text editor available and can be used of this.
https://github.com/esp8266/Arduino/tree ... /FSBrowser

But I'm sure that is not what you want. It would be too hard for most users to create a web page by typing in all the code.

If you wanted a form where the user could select different options, and that data would be used by the ESP8266 to create a new webpage. Then yes that is possible.

With the right javascript code (in the initial web page) you can make a very user friendly webpage builder application served from the ESP8266. The more sophisticated the application the more complex the code to achieve it.

Re: Dynamic web pages?

PostPosted: Sat Jul 13, 2019 9:17 am
by Bonzo
Dynamic pages to me mean using php and I doubt you will be able to do that.

I do not know how you will write to a memory with just html. I suppose you could create/modify a page with JavaScript as rudy suggests but when the browser is closed the modified page would be lost.

Re: Dynamic web pages?

PostPosted: Sat Jul 13, 2019 10:33 am
by rudy
First it needs to be clear if you want a dynamic webpage that changes based on information accessible to the ESP8266 (dynamic content), or if you are looking to create a new webpage with an existing webpage on the ESP8266.

A webpage with dynamic content is often done. Creating a new page with a current page typically is not done. I have a project where I need the user to enter some information on the assembled system, and that information is used to create a page layout with the components that the user specified. This resultant page will be specific to that user's setup. If someone else went through the same procedure, but with different components, the resultant page will be different. Both show information from all the ESPs in their system.

Without specifics, it is hard to say if what you want to do is practical.