Is it possible to build a pure HTML registration?

4

I need to create a registry with name and description in HTML, or PHP, that does not make use of a database but I do not know if it is possible.

Something that I could save the records to file and also upload them back to the form.

The page would contain:

  • Form with fields Nome and Descrição (field to 200,000 characters minimum)
  • Grid that would list the records, which could be selected for editing
  • Save, edit, remove, and create new registry buttons

The idea is to run on a computer without having to install a database system, or something like that. It would run on its own without relying on other programs or installation, running only in the browser.

Any ideas how this can be done?

    
asked by anonymous 02.11.2014 / 16:31

2 answers

2

Well, you can do this using HTML and PHP, but you would need to handle server-side files, note that: It is possible, but it is not very secure since anyone with access to the server could access the files ( Unless they are encrypted).

Let's go

First you would need to put together a common HTML form, I think you already know how to do this, if you do not know, you can take a look this link .

The action of the form should be pointing to your PHP page, in which you should receive all the required data via POST or GET .

The PHP page structure should look something like:

if(isset($_POST) && !empty($_POST))
{

 <Criação dos campos>;

}

Within this IF structure you will have to perform the whole process for creating a file in an XML format for reading, this file can be in any formatting you wish, ie you can create tags inside it so that is simpler for you to read the same.

Ex:                          Pedro Henrique Correia         Lorem Ipsum            

Then you can record using this tutorial or one of the following:

You can give a name and a recording path as you like, and to read and fetch the data you want, you can read this here .

Note that if you want to read an encrypted file, you first have to read it as String, and then use simpleXml to turn it into XML

If the system uses a lot of data, I advise you to add nodes, instead of creating a file for each user or for each record, so when the system starts it can read all the documents in an object or an array at a single time, making processing infinitely faster.

    
06.11.2014 / 02:15
0

Another legal way to solve your problem is to use HTML 5 Local Storage, roughly it is a database contained in the browser, as if it were a cookie that does not have an expiration date, close the browser the data stored in the Local Storage is not lost, it is important to point out that the data saved by this resource can not be accessed by other computers through the network, will work only in the browser of the client who owns and saved the application. What do I need to use Local Storage? knowledge in HTML and Javascript, follow a link with an example of using it: link

    
06.11.2014 / 11:45