0

So I am creating a website (HTML/PHP/Jquery/MySQL) that needs to communicate to a specialized printer (a fiscal printer with a special driver), and I was planning on keeping it completely online on a remote server. However, I found out that the driver's proper use requires that I use a local server to run the tool that allows the website's PHP to interact with the driver.

Now, I am aware that I can make the website completely local while maintaining a remote database and pushing updates onto all of the computers that will have this software whenever I need. This would solve the problem at hand quickly. However, I prefer to maintain a remote server to make sure that any updates or fixes can be done quickly instead of having to manually update hundreds of computers in the future. I also looked into HTML5's offline capabilities, but that doesn't help me since I need to use the PHP locally.

What I want to know is if it's possible to have the website run mostly on the remote server, while allowing this one functionality to run on the local server? That is, is it possible for me to force the PHP to use the local server when I need it to?

Thank you in advance :)

PS: I asked this question in the Webmasters page, but it was marked on hold because it is a programming question. I'm new at this, so I hope that I got it right by posting it here (I checked the FAQ, and I think I'm on the safe side.)

1 Answers1

0

You plan sounds well. Sometimes these drivers only work locally. You can have a condition if that action is called you can forward the request to the local server.

For example the site is running in remote server. You have a request that required the local host "/getPrinterDriver" dispatch and handle with $localURL. You should have this source on the remote server to point to the local server.

unixmiah
  • 3,081
  • 1
  • 12
  • 26
  • Thanks, this is a push in the right direction for me! However, I can't seem to find out how to do that. So let's say that the functions that run the driver are on the local server, how do I access it using the $localUrl? I get the idea behind it, I just can't get to the syntax. How do I include the page with the functions in it and how do I access them? I'm sorry if this sounds like a beginner question, but I've never done this before and I can't find the proper online documentation. – Mohamad Awada Oct 13 '14 at 22:54
  • Say you have 2 sets of web folders that are accessible via internet. One being local; make sure that local instance is accessible via internet. The other one that's on the web would reside on line. When you call the function that needs to use the local server, just use that domain name and go into your scripts to call that action. It would be helpful for you to white board it out. When I mentioned "$localURL" i meant to put that stuff in a config file; for example; $localURL = path-to-local-instance/{then-path-to-script} to put it simply – unixmiah Oct 16 '14 at 13:36