Submit PDF Form Data to Database - php

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?

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

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.

Fill PDF Form From Local Database using 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.

Writing to CSV database file from php application

I have a simple PHP/HTML application (hosted on Heroku) which runs a survey. I would like to save the responses to this survey (only 4/5 questions) to a CSV file for later analysis. These responses are currently saved as PHP variables so a form submission is not possible at the moment.
What is the best way to do this? I'm assuming this would be easiest using Javascript but am open to suggestions. Also, should I put the CSV file on a different server?

how to upload files to PHP server with use of Python?

I was wondering is there any tutorial out there that can teach you how to push multiple files from desktop to a PHP based web server with use of Python application?
Edited
I am going to be writing this so I am wondering in general what would be the best method to push files from my desktop to web server. As read from some responses about FTP so I will look into that (no sFTP support sadly) so just old plain FTP, or my other option is to push the data and have PHP read the data thats being send to it pretty much like Action Script + Flash file unloader I made which pushes the files to the server and they are then fetched by PHP and it goes on from that point on.
I'm assuming you own the PHP server.
Use FTP. See here and here.
Make a file upload form with PHP, and use python to fill out the form. See this and this.
(Usually a bad idea) Use PHP to write small server that listens for data and then writes it to a file.
I think you're referring to a application made in php running on some website in which case thats just normal HTTP stuff.
So just look at what name the file field has on the html form generated by that php script and then do a normal post. (urllib2 or whatever you use)

Categories