| View previous topic :: View next topic |
| Author |
Message |
aaron
Joined: 14 May 2006 Posts: 1 Location: Malaysia
|
Posted: Sun May 14, 2006 5:19 am Post subject: New to PHP-GTK |
|
|
Hi,
I'm a beginner PHP developer and came across PHP-GTK as an extension of PHP.
I would like to know is there anyway I can use PHP-GTK to interface with PC's parallel port or USB port?
How about using MySQL with PHP-GTK?
How well is PHP-GTK in big development such as Accounting System?
As I already have some knowledge in PHP, I would prefer PHP-GTK then others if PHP-GTK is abled to develop big scale application.
Thanks.
Aaron |
|
| Back to top |
|
 |
cweiske
Joined: 08 Dec 2005 Posts: 454 Location: Leipzig/Germany
|
Posted: Sun May 14, 2006 8:17 am Post subject: |
|
|
Aaron,
All the modules you can use with PHP can be used with PHP-Gtk. PHP-Gtk itself is just a module for PHP, so PHP sets the limits.
Personally I have no idea how to communicate with an USB or parallel port, especially if you're on Windows. Perhaps other people.
I personally have developed some larger scale projects with both PHP-Gtk and PHP-Gtk2. You just have to remember that PHP-Gtk2 has not even released an Alpha version (but should be due to soon) but looks much better than PHP-Gtk1.
PHp-Gtk1 is stable, but looks ugly and you can't destruct object which means that your memory will fill up after some days or weeks. |
|
| Back to top |
|
 |
omis28ca
Joined: 26 Dec 2005 Posts: 11 Location: Fresno, CA
|
Posted: Mon May 15, 2006 1:48 am Post subject: Parallel Port Programming |
|
|
As far as i know there are are few windows DLLs that allow you to read and write directly to a pc's parallel port, one is called Inpout32.dll whitch can be found at http://www.logix4u.net/ their website provides lots of usefull information on parallel port programming but in order to use that dll i believe inpout32.dll will have to be converted to a PHP extension so it can be used directly from php.
If someone is willing to take the time to program that extension it can open up a many new applications for PHP-GTK such as data acquisition, motion control for robotics , home control and many other electronics related applications. |
|
| Back to top |
|
 |
clange
Joined: 24 Jan 2006 Posts: 11
|
|
| Back to top |
|
 |
rajuvk
Joined: 02 May 2006 Posts: 10 Location: Kerala, India
|
Posted: Mon May 15, 2006 10:31 am Post subject: |
|
|
Regrding using MySql it is the same as using in the web sites. Only that in PHP-Gtk you have to use the Gtk generated windows and window components like entry boxes, labels, trees to present the data. So you have to learn how to use them. unless you know how to call the Gtk classes it will be very difficult as the manuals are under creation and is sketchy.
I am also exploring the utility of PHP-gtk for development of a project which include financial accunting among other things. I choosed PHP-gtk , due to my past experiance in PHP. But the lack of documentation on how to use the gtk classes is creating difficulties. I am also find that creating printable reports also will be difficult with PHP-Gtk. Another difficulty is creating executables for distributing the application.
Therefore I am looking into others like Python-gtk, which has better documentation, and seems to be more capable than PHP-Gtk. However I have not yet abandoned PHP-Gtk.
Regards,
Raju |
|
| Back to top |
|
 |
Osiris
Joined: 17 Dec 2005 Posts: 65
|
Posted: Mon May 15, 2006 11:25 am Post subject: |
|
|
When using the php-gtk docs (under www.php-gtk2.de) you should also use the original gtk-api docs from gtk.org, when the method is undocumented in php-gtk docs.
In most cases, the gtk-api docs show you the right params and there order. |
|
| Back to top |
|
 |
kksou
Joined: 06 Sep 2006 Posts: 25
|
Posted: Wed Sep 06, 2006 9:21 am Post subject: |
|
|
Was researching materials on php-gtk2 and happen to see your post.
Yes, we have developed applications using php-gtk2 that outputs to a thermal printer through parallel port.
Let me know if you're still interested. |
|
| Back to top |
|
 |
rgljr
Joined: 10 Apr 2006 Posts: 15 Location: Minnesota, USA
|
Posted: Fri Sep 08, 2006 3:00 am Post subject: PHP GTK Printing |
|
|
Haven't tried it yet but I was looking at printing a while back and ran across some possiblities in the way creating a file to print and calling a batch file or executing a command to actually do a print. Such as:
NOTEPAD /P whatever.prn -- will print the text file whatever.prn
Since PHP originally generated HTML another option may be of more interest
RUNDLL32.EXE MSHTML.DLL,PrintHTML whatever.html -- print the file whatever.html
Example Batch file can be found at:
http://www.robvanderwoude.com/
He has several example of printing from a batch file in a page titled
Print Files from Batch Files
I have had great success executing command and batch files from PHP-GTK2 to fill in those places where it doesn't have quite the functionality I need. The Batch or script file concept also works well for multiple platform programs allowing operating system unique areas to be dealt with either in PHP or scripts/batch files. |
|
| Back to top |
|
 |
leon_pegg
Joined: 12 Jun 2006 Posts: 113 Location: hemel / UK
|
Posted: Fri Sep 08, 2006 12:00 pm Post subject: |
|
|
| you could create pdfs witch the user could open this would stop it being system dependant eg your examples would only work on wndows not linux this defets the object of php-gtk. |
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Fri Sep 08, 2006 1:43 pm Post subject: |
|
|
| kksou wrote: | Was researching materials on php-gtk2 and happen to see your post.
Yes, we have developed applications using php-gtk2 that outputs to a thermal printer through parallel port.
Let me know if you're still interested. |
I'm curious to hear about this, too. Please let us all know how you go about it.
-Ron T. |
|
| Back to top |
|
 |
kksou
Joined: 06 Sep 2006 Posts: 25
|
Posted: Fri Sep 08, 2006 7:02 pm Post subject: |
|
|
We simply write straight into parallel port with fopen and fwrite. Once the handle is created, you can write to it like a standard file.
| Code: | $printer_handle = fopen("PRN", "w");
fwrite($printer_handle, "this is a test string");
fclose($printer_handle); |
As noted earlier, our application prints to a thermal printer, not inkjet printer. So the above works pretty well. We are able to print receipts and barcode labels - straight from within php-gtk without the need of external programs.
Our application runs on windows platform. I guess it should run on linux with standard parallel port too. |
|
| Back to top |
|
 |
cohort
Joined: 07 Feb 2006 Posts: 47
|
Posted: Sat Sep 09, 2006 2:22 am Post subject: |
|
|
| kksou wrote: | | I guess it should run on linux with standard parallel port too. |
On linux, you should print standard text via the "lpr" command, which will handle the printer for you. |
|
| Back to top |
|
 |
ron_t
Joined: 11 Dec 2005 Posts: 78 Location: Gatineau, Quebec
|
Posted: Sat Sep 09, 2006 6:47 am Post subject: |
|
|
| kksou wrote: | We simply write straight into parallel port with fopen and fwrite. Once the handle is created, you can write to it like a standard file.
| Code: | $printer_handle = fopen("PRN", "w");
fwrite($printer_handle, "this is a test string");
fclose($printer_handle); |
As noted earlier, our application prints to a thermal printer, not inkjet printer. So the above works pretty well. We are able to print receipts and barcode labels - straight from within php-gtk without the need of external programs.
Our application runs on windows platform. I guess it should run on linux with standard parallel port too. |
Thanks!
-Ron T. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Nov 29, 2006 5:26 pm Post subject: |
|
|
Hi,
I'm a beginner PHP developer and came across PHP-GTK as an extension of PHP.
I would like to know is there anyway I can use PHP-GTK to interface with PC's parallel port or USB port?
How about using MySQL with PHP-GTK?
How well is PHP-GTK in big development such as Accounting System?
As I already have some knowledge in PHP, I would prefer PHP-GTK then others if PHP-GTK is abled to develop big scale application.
Thanks.  |
|
| Back to top |
|
 |
|