Fill PDF Form From Local Database using PHP - php

My goal is to create a way fill a PDF form from a database. I have an inventory of items that I want to track and would like to do so by outputting to an existing pdf form. I would like to use a database that can easily be edited by a gui like access (that is installed on the computers at work). I am on work computers and am not sure if I will be able to run an exe's on them(like trying to use java with iText).
That sums up my goals and issues. I am very new to programming and was thinking I could do this with a webpage and have the database and the pdf form all stored in the same file and use the webpage to make queries to fill the pdf form while using access to edit the database for the inventory.
It appears php would be the best way to do this but it looks like php requires a server to run its code. So I was thinking I could host the php code on a server and attempt to access a the database at work using the db's shared drive location. Since I am new to database I am not sure if that is possible or if I would need to have the database hosted on a server.
Does anyone have any recommendations on how I could accomplish this. I was thinking about just having it all server based but I signed up for 1and1 hosting to experiment with and its MySQL database cannot be accessed remotely. I guess this is not a big problem but it would require me to develop my own gui for db editing.
I am not necessarily looking for code examples, just big picture ideas on how to accomplish this.

Related

PHP long-polling with .txt-File instead of a MySQL Database

I want to implement a simple long polling system in PHP. A simple Szenario:
The Project is based on two websites. Website A and Website
B. There are two Users. One on Website A (UserA) and one on
Website B (UserB). On the Website A is a Button. If UserA push the
Button, the color of Website B change instantly.
Of course i can do this with a MySQL Database, but this seems way to big, because i just want to transfer one Bit.
Are there any other oppurtinitys to store one Bit on the Server an have acces from all PHP Pages, which are hosted on the Server?
I thought i could use a simple .txt file, but i am not shure if the Server Crushes if two diffrent Websites want to access to the same file. Is this a problem?
Or have you any other Ideas how to resolve it?
I would not recommend using a text file, since I/O operations is pretty slow compared to other methods.
You have to read the file on every page load/refresh or even worse, with an ajax request to do it instant. I think I would recommend something like Redis / Memcached and make some sort of ajax call to read from that (if you want it to be instant).
If you don't have access to the server, to install that kind of software, I would use a MySQL database.
Hope it helps

Submit PDF Form Data to Database

What is the most efficient and simplest way to submit a filled in PDF form that resides on a users local machine (not on the server) to a database? is this possible? I have looked online and have seen CGI being mentioned a lot but I prefer to use something like PHP.
If the document resided on the server then using something like PHP would not be so difficult to handle this, but what if the PDF document is sitting on a local machine? What approach can we take to send the data over to a database then?

General CURL and Order of operations

This is a very general question but I'm not sure the best way to go about things here.
I have two applications that want to interface. One is a Windows based app that has a database and can send CURL commands. The other is a very simple website with a MySQL database.
The main feature is that these two apps can swap database data between each other. The Windows app is currently using SQLAnywhere but could be converted to MySQL.
Anyway: On the web app there is a js function to dump all data requested into a .txt file, essentially a mysql dump. This function will be called by the Windows app via CURL. It will say
"Hey, dump the data for this table in to a txt file, then let me download it."
What I am unsure of is: Once the request to dump the data is complete, the Windows app will want the file right away. How do I say back to it, "Wait until the file is completed, and then you can download it."
I was thinking of making a dummy file and then a .txt file so the Windows app essentially gets stuck in a loop (with a timeout) until the file is renamed to .txt. Is this a good way to approach this?
Thank you.

Android web app - php with local database

I have a very simple web page in PHP that uses a MySQL database to randomly feed a simple quiz that goes on forever as long as the user wants to keep answering questions.
I want to move this to my Android to be able to use it offline. I used jQuery Mobile to adapt the layouts to the smartphone. So now I want to move the database to a local database and remove all the need to an internet connection. I have absolutely no experience on Android development so if anyone can help me with a few questions, I'd appreciate it:
How can I store my existing database in the smartphone?
The only actions that the app performs on the database are selects. The information on the database will grow with time (not much, I just want to be able to add more records with time). Is there any tool I can use to manage the local database and add the information as I need (as I do now with PhpMyAdmin)?
The web page exists online right now, will I be able to run it locally as it is? (aka, PHP page with css and js files)
Thanks in advance.
1) Android databases are done in SQLite. I'm unsure exactly what the syntax difference between mySQL and SQLite is, but if a straight dump/import doesn't work, you could export to csv/import that way. For info on getting an external database packaged with an app, check Using your own SQLite database with Android applications. It's a very helpful guide to getting it set up.
2) I use a Firefox add-on, SQLiteManager. I hate doing it, as it's the only reason I have Firefox installed any more, but on *nix it's the best option I've found. It's either that, command line, or SQLiteMan, which I found feature-lacking. On other platforms, I can't comment.
3) I don't know if PHP has a good library for SQLite. If so, you'll most likely need to do some modification to work with that instead of mySQL. If you can get that running smoothly, you should be able to drop it into a webview. The other option is to redo it in Java.
Good luck!

access + mysql converting to webplatform = (php + asp.net + mysql)?

i have a database that is written in access. the access mdb file connects via ODBC to a local mysql database. i have a bunch of sql and vba code in the access file. i dont expect the database to surpass 100mb. currently it is around 10mb. i will need to have multiple user access. (no more than 10 users at a time)
i need to convert this database from being a local one to a web server, and i need to make a web interface for it.
how do i get the current local instance of mysql database to run off a webserver? i am currently running it off wampserver 2.0. i dont have experience putting a database on a webserver.
i have an OK vb.net background. i have never done any web applications. here's a picture of the access form that i may need to replicate to work off a website:
alt text http://img42.imageshack.us/img42/1025/83882488.jpg
which platform should i use as the front end to this thing?
would it be possible to just run this access file off a webserver instead of programming a new front end for it? is that not a smart idea?
thank you for your help!
If your webserver has TCP connectivity to your existing database server, and its hosted in a suitable place (eg, don't have your webserver in a datacenter connecting to a database server on your office DSL connection), then no move is required.
If you do need to move it, it's as easy as creating a backup/dump, and restoring it elsewhere.
As far as the frontend, there are MANY technologies that will do what you need (ASP.NET, PHP, Python, Ruby, Perl, Java being the most popular ones, not necessarily in that order).
Use something you are comfortable with, or that you are interested in learning (provided you have the time to do so)
Use something that runs properly on your target webserver. Really, ASP.NET is the only one that has any major issue here, as it's limited to Windows.
Access itself has no direct web-accessible version. A Google search finds some apps that claim to convert Access forms to web-based, but I will not link to any because I don't know how well they work. I'm certainly leary of anything like that, because web apps are a different breed from Windows apps. If you are going to go that route, be sure they actually generate HTML output; make sane, clean source; and offer a free trial so you can verify it actually works.
Really though, a form like that is reasonably easy to reproduce with some basic knowledge of server-side programming and some HTML.
I don't have any experience migrating access to a web-based interface, although I have heard of people going straight from access to a web page. MySql is exceptionally easy to migrate. MySQL.com has a program called mysqldump that comes with the standard install of MySQL that allows you to export your database straight to a text file that can be used then with mysqldump to import it on another server. I don't believe the WAMP server comes with the command line tools although they can be downloaded from mysql.com. However, if it has phpMyAdmin, then there is also an export feature with that as well that will generate a .sql file that can be imported to the webserver using phpMyAdmin. One thing to keep in mind though is that I have had very little success mixing and matching these methods: ie, I've never been able to get a mysqldump-created file to work with phpMyAdmin and vice versa.
Good luck!
The link will help you to export and import mySQL database
May be on Windows web server there is an opportunity to run Access files, you can check, but any way if you have some programming skills, I would say that it is not difficult to crate a php script which will query your database info and will edit.
Migrating an Access application to the web is quite difficult, because you can't translate an Access form 1:1 into a web page. Web apps are stateless, whereas Access is built around the concept of bound controls and bound datasets.
Secondly, it is impossible to easily replicate an Access subform.
Third, you lose tons of events that Access forms and controls are built around.
In general, a web page that performs the same task as an Access form will bear little or no resemblance to the Access form, simply because the methods for accomplishing the same tasks and the UI widgets available to you are so completely different.
One thing to consider is whether your users need a web application or if they just need to use your existing Access application over the Internet. If the latter is the case, Windows Terminal Server/Citrix can do the job for a lot less money, since there's no conversion needed. You do need to provision a Windows Terminal Server, set up a VPN and purchase CALs for the users, but the costs of those are going to be much less than the cost of rebuilding the app for web deployment.
It may not be an appropriate solution, but it's one that you should consider, I think.

Categories