Pass data between webpage and VB application - php

I am developing an application for internal use in our company. The purpose of this application is for document imaging. What we are wanting to do is print a barcode label to attach to documents so that when they are scanned in a piece of software such as vfiler will be able to read the barcodes and know how to file them.
The main focus is our ERP system which is web based (PHP). We are wanting to modify the code to allow the user to print the barcode label immediately once they enter an order or PO. I have access to the source code for the ERP web pages. I don't know of any way to make a web page print to a printer without displaying the printer select dialog. So, I decided that I wanted to try and create a VB application that would do the printing of the barcodes. This would allow me to bypass the the printer select dialog.
Now for the question. Is there any way to have a web page (PHP) running on the server call a VB app to perform a task? So, if I had a button on the webpage and the user clicked it, that button would somehow send the pertinent information (Order number) to the VB app and the VB app would print the barcode. The VB app will always be running on the machine. The label printers will be Zebra USB label printers on each person's machine.
Any thoughts appreciated.
Thanks,
Keith

The way I implemented something like this was to have an Windows service, running on a different system from the webserver, watching the upload folders on the web server, then moving the files to the appropriate location for further processing. I tracked the movement of files through the system by creating an initial record upon a success upload, then creating a transaction record for each activity afterward (printed, faxed, emailed, sent for manual review, etc). This insured a reportaable audit trail for each document and helped identify 'orphan' files that would happen sometimes.
The important thing with a service like this is making sure that you've configured security properly so that the service has access to resources like printers and network drives.

You could make the VB app a service, then implement a FileSystemWatcher on a specific folder. When the user clicks the Print button, all the webpage does is save a file with the necessary info to the folder that is being watched.

It seems an old question but maybe this answer would help someone else. It would be much easier to implement this with a command line app. Just pass the necessary parameters into the exe file with PHP exec().
exec("barcodePrint.exe -barcodeValue");

Related

Windows interface to a web application

I have a simple web application written in PHP. You can log in and upload/download some files. Now I want to integrate those functions into windows. Imagine a user right clicks a file and can click to Upload to my application. The system automatically sends those file to the webserver via POST and maybe get even a reply back from the webserver. Is there a good solution for something like that?

Is there any short-cut to serving php pages in localhost?

I have a project using WAMP/EasyPHP and I want to produce it to my client as a standalone app so that he just needs one click to access the web page locally instead of running the WAMP/EasyPHP server and typing the IP address in the address bar etc. I hava Googled and found many solutions like phpdesktop, nightrain etc, but I want to use my existing technologies as well as my code. I want to know whether is it possible to create an executable which serves as an icon and upon clicking which starts the server(WAMP or so) and also instantly evokes the browser to fetch the URL of my application.
It sounds like you would be better off making a website here, that is what PHP is best at after all. If you have not already I suggest picking up a background text such as this one: http://shop.oreilly.com/product/9780596157142.do to give you the basic knowledge but it should basically be a case of getting a hosting package, uploading your files and your database. Then you just need to add authentication so that only your client can see the website.
However if you have your heart set on a desktop app, I suggest: http://www.tidesdk.org/ it will be a more complex solution but allow you to build an app along the lines outlined here, just bear in mind that the first option is probably easier than this.

Selenium Server from website

Does anyone know of a simple way to send commands to a selenium server over a web interface? I am trying to automate the filling of several online forms (each requiring a login) but I don't want to do it from the local machine but rather a website so my employees can use it as well. This would save us time being that we currently fill out 8-10 different forms all with the same basic data. I have looked into form filling software but I really want this done by one server in the background. I don't think CURL would able to deal with the amount of DOM elements each website uses and some use those fancy ajax elements. I am pretty good at writing PHP, my original thinking was I could setup the selenium server with PHPunit and execute the scripts from any remote machine. I was sad to find this is still a command line only approach.
I appreciate any advice or technical info provided! Of course, if anyone knows of a better solution than selenium for automating web form filling by a server I would appreciate that info as well.
For this you can create your own Web interface and submit the data in some remote database.
Then whenever you execute testcases it should take testdata from the database.
You can use HUDSON and integrate the selenium project in there. Hudson is a CI tool which has a UI and logins as per your requirement you can also create an individual login for your employees and just they have to login and click on a play button to fill the forms.

just a bit of strategy

I need some guidance around how to develop the app I'm working on.
It's basically a backend system to manage photos and slideshows (eg arrange photos in albums, decide which ones to publish, update names and captions etc)
I would like to avoid giving the source code to clients but would like to keep the actual photos and thumbnails on the client's server.
I'm not sure what would be the best way to achieve this. In my mind the steps are:
a) client uploads a photo to MY site
b) photo is registered into my DB
c) the original photo is moved to client's server
d) thumbnails are generated and saved on client's server
then the public site:
e) install the public website on my client's server;
f) when a user is browsing the client's website, the script gets the list of images to show from my database, and gets them from the local server.
(hope I made myself clear)
basically the question is: what's the best way to give the client minimal/no access to the source code?
I agree with benjy, however, you can get away with using an API to manage the system specific calls, and just have an upload handler that communicates back to your API on the clints box, so they still have some code, it is minimal, and the code requires an API call to function. That way you reduce the DB need, and reduce the resources required to manage the clients code.
API is used to authenticate / manage communication while the upload / manage scripts handle the upload/image handling.
IMO, this seems a little unnecessary. What exactly is your concern about having the source code rest on a client's server? All you need is a signed license agreement between you and the client preventing them from doing anything with it.
Or, if you really don't trust them, just sell it as hosted software. No point in the above procedure, which is rather convoluted (no offense), when you can just have everything on one server.
Just my $.02.
You can obfuscate the code with a commercial tool like IonCubelink text, or you can develop your application and license it using a SaaS model, and provide an API for the client software to use.
Zend Guard, SourceGuardian, IonCube, and similar are other viable options if you cannot keep it local but want to make it difficult to find out what the "source" is.

How to record voice files using PHP, FLASH

I am developing an application where I need to record voice(for those who does not have a webcam so they can use only microphone to record voice) or video(those who have a a webcam - like laptop or external) files and save them on server, thereafter save the file name and logged in users id on database for later access.
I know I need to use some sort of flash app for this. But is there any free one which could server this purpose or even if there are paid ones which could serve this purpose that would be great. I tried google but may be I was not being able to go after the proper term or something, I could not succeed finding a proper solution for this.
Please, help me out!
You can do that simply using jRecorder, a jQuery plugin. You don't even need a Flash Media Server or RED server. JRecorder is same as jPlayer, you can use jQuery and HTML to design your recorder and you don't even need Flash or Action script knowledge for this.
jRecorder uses 1 pix hidden swf file which manages all the recording / previewing and sending the file data (wav file) to a URL you defined (Where you can write code in PHP or Java to receive a POST file)
It is quite simple and tidy.
You can download this Plugin from:
http://www.sajithmr.me/jrecorder-jquery
I have same feature in our latest project, the client want to have video recording from webcam and the video appear in the user's profile page.
For the server, we implement the RED5 server. It need a Java virtual machine in your hosting. You can read the detail requirement and installation instruction in the website.
To handle recording, we develop our own flash application, because the client request a custom interface to match with the overall website interface. I don't know the detail, since we outsource it to a fellow flash developer. Maybe you can see follow this thread, the development of flash recording by JeroenW.
To play recorded video, you can use any flash video player that support playing rtmp video source. You cannot play the recorded flv file in RED5 directly, since the file lack of metadata required by the player. Serving the recorded file as rtmp is done by RED5.
In addition to red5 there is Adobe's own Flash Media server that allows you to record audio/video straight to the server.
Or if you feel geeky you might be able to put together your own solution for this using a socket connection to the server and decoding the stream yourself on the server side. You should be able capture the audio/video locally into memory and then feed the byte stream up to your own server application.
There are Open Source solutions but you will need an own server to run them.
There is no way to run these things from shared hosting except if your provider is really nice, and ready to install the necessary software.
I asked the same question a few weeks back, check out the answers.
This question when googling "How to record audio php" comes up first so here for anyone from the future.
A simple way to record audio with flash and save it with PHP:
https://github.com/clouddueling/SimpleRecorder
Record audio, post audio data to your choice of url.
You could try recordmp3online.com which has an SDK. The nice thing about this one, is that it doesn't need a third party server(ala Red5), and supports mobile devices that don't have flash installed.

Categories