473,516 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to write a program (not a webpage) in php?

I'd like to write a program that running all the time: just a simple
program, but written in php.
1)How can i do that?
2) I'd like that this program listens on a port to recive a message: how can
I do?

thank you in advance.
Andrea.
Sep 9 '05 #1
6 1565

"_andrea.l" <an******************@libero.it> wrote in message
news:%N********************@twister2.libero.it...
I'd like to write a program that running all the time: just a simple
program, but written in php.
1)How can i do that?
2) I'd like that this program listens on a port to recive a message: how
can I do?


Hello andrea

WHy don't you use something else then ? Use C or JAVA ....
PHP I think is only web scripting lunguage.

Angelos
Sep 9 '05 #2
_andrea.l wrote:
I'd like to write a program that running all the time: just a simple
program, but written in php.
http://php.net/features.commandline
2) I'd like that this program listens on a port to recive a message


http://php.net/manual/en/ref.sockets.php

--
E. Dronkert
Sep 9 '05 #3
_andrea.l wrote:
I'd like to write a program that running all the time: just a simple
program, but written in php.
1)How can i do that?
2) I'd like that this program listens on a port to recive a message: how can
I do?

thank you in advance.
Andrea.

I have absolutely no experience with this, but I thought it can be done
using GTK: http://gtk.php.net/
Sep 9 '05 #4
Angelos wrote:
"_andrea.l" <an******************@libero.it> wrote in message
news:%N********************@twister2.libero.it...
I'd like to write a program that running all the time: just a simple
program, but written in php.
1)How can i do that?
2) I'd like that this program listens on a port to recive a message: how
can I do?

Hello andrea

WHy don't you use something else then ? Use C or JAVA ....
PHP I think is only web scripting lunguage.

Angelos

Angelos,

Not true. A PHP program can run standalone, also.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 9 '05 #5
_andrea.l wrote:
I'd like to write a program that running all the time: just a simple
program, but written in php.
1)How can i do that?
2) I'd like that this program listens on a port to recive a message: how can
I do?

thank you in advance.
Andrea.


Andrea,

It's not too bad. Ewoud pointed you to the socket interface; it's as
simple as opening a socket, listening for a message, and once received,
close the socket. Loop around and do it again.

You might also want to listen for a 'special' message such as "SHUT DOWN
NOW" which tells the program to shut itself down gracefully. Otherwise
you would have to kill. Not that this *should* cause a problem - but
I'm always in favor of graceful shutdowns :-).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 9 '05 #6
_andrea.l wrote:
I'd like to write a program that running all the time: just a simple
program, but written in php.
1)How can i do that?
2) I'd like that this program listens on a port to recive a message: how can
I do?

thank you in advance.
Andrea.

Start here probably

http://us3.php.net/manual/en/function.fsockopen.php
Oct 6 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1456
by: Colin Colin | last post by:
I have an ASP program that is getting an error. When I get the error I get Page Cannot Be Displayed along with the line that causes the error and what the error is. What I am not getting is any data that I write via response.write before the error occurs. The error is happening in a loop, on the third line below: RESPONSE.WRITE("x=" & x...
0
4112
by: prakash | last post by:
Dear Friends I am new guy to Visual C++.NET I've program to save website as a image vc++.net . It have a function "SaveSnapshot" to save the webpage as an image On that function ifor saving as a image it uses image.Save method() This image.Save function have two overloaded form's first one is file name
2
1888
by: | last post by:
Hey All, I'm using response.write to create a dymantic webpage. Basically just write the HTML out with response.write. The problem I am having is that when I do this it puts the Meta tag info for the webpage at the bottom of the page because the meta info was added with the form designer. Is there away to have the reponse.write output...
2
1236
by: Ben | last post by:
Hi I have a string variable which is populated in the Page Load sub of my vb code behind for my webpage. I cannot seem seem to write this text to the webpage. What is the best method of achiving this. Thanks
18
16367
by: jmd | last post by:
Hello, I posted the following in the C# forum but without one answer. But perhaps now in vb.net someone has some guidelines ! This is my question : I want to write a vb.net program that does completely automatically what, until now, I do manually, witch is describe below : 1. I launch IE (6)
3
1860
by: jcnews | last post by:
I want to learn how to write a BHO for Internet Explorer. I am somewhat new to VB.NET. The specific thing that I need accomplished is a sort of browser hijacker (for legitimate reasons). I need the public-access computers at work to always be set to a certain webpage. I want to write a small program (BHO) to run every time IE starts that...
17
3423
by: chris.schwalm | last post by:
I would like to first state that I have searched through the archives and found a lot of related material, but am still new enough to javascript that I can't fit all the pieces together yet. So here is my situation. I would like to create a program that grabs the source of a displayed webpage, sends it off to another program, then receive...
12
2158
by: ben | last post by:
hi i am starting a small business offering computer help to the local area i would like to write my own system where i can store customer information, and link this to orders, then print invoices automatically. can anyone tell me where to start? should i get a book on VB or C or something? or is it really a better idea to use a well known...
0
1043
by: Blue Yoda | last post by:
Hi, I am really new to all this stuff so I could really use someone's help on this. I have a new program Word to WebPage. A conversion program. I use windows xp. After downloading the program and going through the process of converting the following error came up. "Invalid Class String"
0
7408
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7581
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.