ToffeeApple
ToffeeApple

Reputation: 13

Converting simple php web app to LAN only

Apologies if this is not the best tag to use. I'm after some basic thoughts on the best way to do the following without using the net.

I've been asked to build a simple ordering service for a busy takeaway. They're looking for something like you get in McDonalds ie a large screen showing the status of order numbers.

I've created a basic system in php/mysql which consists of 2 pages which look very similar however the staff one has the ability to change the progress when an order item is clicked. The 2nd page is the one that will be displayed on the customer screen and simply queries the database and outputs the results, the page refreshes every 10seconds or so.

The idea is that the customer page will run on a large screen in the restaurant while the staff page will be on a couple of touch screen tablets. As there is no need for internet usage I would like to move this to an internal server but am not sure where to start?

Can I simply setup a server using an old PC, install php and mySqL on it and set it running? Do I then just reference the IP Address of the "server" on the tablets ie something like 192.1.1.1/staffpage.php?

Or is it a bit more complicated than that?

Upvotes: 1

Views: 166

Answers (2)

CUGreen
CUGreen

Reputation: 3184

You have the right idea.

I would suggest building a LAMP stack (Linux, Apache, MySQL, PHP) on a cheap linux box. As ivanivan suggested, a Raspberry Pi would be ideal.

There are many tutorials on setting this up with the Pi and Linux.

However, if this is too technical then using an old computer with WAMP/MAMP would also work.

When the server is setup and running on your local network using 127.0.0.1 or localhost, then the ip address of that machine should be reachable by other devices (assuming your firewall allows it).

You could simply load the webpage in a fullscreen browser and use client side javascript to refresh the page every 10 seconds. Or if you wanted to get clever, you could use ajax or websockets.

On a side note: Another completely different option could be to use a node.js server on a Raspberry Pi and do away with Apache, PHP and Mysql all together.

I hope this helps.

Upvotes: 1

Gam eek
Gam eek

Reputation: 3

yes you can use the localhost and you need a corn job to refresh the page every 10s

Upvotes: 0

Related Questions