Javascript control page and user view page

I am currently working on a project in which a user enters a lot of data constantly during a window hour. I want one user to control all the data using some kind of control panel, and then have a link that they can distribute to other users, which will allow them to view this data without being able to edit it.

I am doing some extremely weird methods right now. I have an XHR request on a control page that fires whenever a field ends up being edited. From there, the data is sent to a php file, which converts the data into a simple text file. Then the distributed link file will download that file once and translate it into the required format.

Some potential problems I am facing seems strange that I am sending starting from javascript data and then sending to a php file and then to a text file and then passing the data back to javascript data again. Another issue that I am facing is that I am not sure about getting users to reload the page when a field is being edited in the control panel after the user has opened the view page.

Am I completely overboard? What are the best concepts I could use to accomplish this task?

+3


source to share


2 answers


If I understand what you want to do, this is how I would do it:

Data entry first

if you have a lot of fields you are better off using the form wizard, I don't have much attention right now but there are a lot of them, just find the jQuery Form wizard

Here's an example: http://i.stack.imgur.com/Luk2b.jpg



The concept of the form wizard is to guide the user through multiple pages and also validate the data. And click "Save" when and ends. Then store the date in the database.

Display content

All you have to do is create a global separate page to display your content. Let's see something like: http://yourserver.com/view/ {id} where id is the id of a specific row in your database.

0


source


I'm not sure if I fully understand what you are going to do. I'm trying to make your job description shorter:

want to create a website where one person can edit the content of one page in 1 hour, while others can view the content change in that 1 hour.

if that's what you want to build, here's the module:

teacher : someone who can edit the page

student : someone who can only view the page



server : information center

teacher client edits the page -> client-client sends update data to server -> server saves data -> server sends update notification to client-client -> client-client receives update notification -> student fetches update data from server

To make this module work well, I suggest trying socket instead of http reqeust like online games or chat rooms do.

well try socket.io

0


source







All Articles