PHP parallel port access

asking for Parallel port Access sample code in PHP

Page 1 of 1

5 Replies - 10084 Views - Last Post: 08 April 2008 - 06:03 PM Rate Topic: -----

#1 aadsaca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-March 08

PHP parallel port access

Posted 02 March 2008 - 11:14 PM

Can you teach me how to access parallel port using PHP? just in Windows.
Tnx, arjel
Is This A Good Question/Topic? 0
  • +

Replies To: PHP parallel port access

#2 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5191
  • View blog
  • Posts: 26,899
  • Joined: 10-May 07

Re: PHP parallel port access

Posted 02 March 2008 - 11:19 PM

I don't know if PHP is designed to (or contains the functions to) access hardware. What I would do, is put together an application that can access the hardware, & performs the functionality that you are looking for, & then just call that program from your PHP code.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: PHP parallel port access

Posted 02 March 2008 - 11:22 PM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks :)
Was This Post Helpful? 0
  • +
  • -

#4 aadsaca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-March 08

Re: PHP parallel port access

Posted 03 March 2008 - 12:31 AM

 
'Inp and Out declarations for port I/O using inpout32.dll.
	Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Integer) As Integer
	Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)

'this is how to give value to parallel port. 
Out(888, 0) '888 here means the address of the port(data port in particular)
				 '0 here can be 1 or 2 or up to 255





This is how give values to parallel port using VB.NET
Now, I'm making its C++/ C / PHP (Open Source for now) version...
please help me

tnx,
arjel
Was This Post Helpful? 0
  • +
  • -

#5 SpaceMan  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 10
  • View blog
  • Posts: 507
  • Joined: 20-February 03

Re: PHP parallel port access

Posted 03 March 2008 - 08:08 AM

in the old Dos days it was print, maybe a command line printer driver would be needed.
print was for dot matrix only.

this being the php forum, can use system() to load/run command line.
Was This Post Helpful? 0
  • +
  • -

#6 hilmi_wicaksono  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-April 08

Re: PHP parallel port access

Posted 08 April 2008 - 06:03 PM

View Postaadsaca, on 2 Mar, 2008 - 11:14 PM, said:

Can you teach me how to access parallel port using PHP? just in Windows.
Tnx, arjel


hiii ....
the common solutions for you is writing cgi script ( typically C ) that will access the parallel port. then embed your script to your php,
another solutions is creating client server socket :
- server socket ( could be app. gui/console or web services ), that will do accessing the parallel port and control the
socket connections
- client ( php ) will send command ( ex. set bit/clear bit of parallel port ) to server or retrieve ( reading data from
parallel port ) the data from server
hope will help you ....

hilmi wicaksono
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1