| | |
php to c++?
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 6
Reputation:
Solved Threads: 0
Hello!
I was wondering if it were possible for me to have a PHP script which would send a line of charactors to my C++ program. The C++ program needs to run all the time to recieve the inputs from PHP. Both the C++ program and my webserver is on the same machine(localhost).
So -> I was thinking on sending a socket to my C++ program and then do a "if" statement to check if it knew the socket, checking agianst predefined stuff and if it regonizes something, it would do a block for that match.
- realchamp.
I was wondering if it were possible for me to have a PHP script which would send a line of charactors to my C++ program. The C++ program needs to run all the time to recieve the inputs from PHP. Both the C++ program and my webserver is on the same machine(localhost).
So -> I was thinking on sending a socket to my C++ program and then do a "if" statement to check if it knew the socket, checking agianst predefined stuff and if it regonizes something, it would do a block for that match.
- realchamp.
0
#2 Oct 14th, 2009
There are a couple of ways to do it that pretty easy. If you're using the socket approach you can just have PHP open a client socket and send data to the C++ app. The other way is just to have C++ poll a file that PHP writes to. The latter is quite expensive but easier to implement.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: Oct 2009
Posts: 6
Reputation:
Solved Threads: 0
0
#3 Oct 14th, 2009
•
•
•
•
There are a couple of ways to do it that pretty easy. If you're using the socket approach you can just have PHP open a client socket and send data to the C++ app. The other way is just to have C++ poll a file that PHP writes to. The latter is quite expensive but easier to implement.
0
#4 Oct 14th, 2009
•
•
•
•
Hmm the first one sounds like something I'd like to have, do you have any tutorials for that? (Both PHP and C++)
For C++ you might want to look around for forums, there's bound to be a link to a good one. If not, just google C++ sockets there is a veritable shit-ton
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: Oct 2009
Posts: 6
Reputation:
Solved Threads: 0
0
#5 Oct 14th, 2009
•
•
•
•
http://php.net/sockets
For C++ you might want to look around for forums, there's bound to be a link to a good one. If not, just google C++ sockets there is a veritable shit-ton
And does the PHP need to run the socket server or are the C++ app supposed to do that?
Both should be able to send back and forward. The C++ program just needs to send basic status reports.
Last edited by realchamp; Oct 14th, 2009 at 7:51 pm.
1
#6 Oct 14th, 2009
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
![]() |
Similar Threads
- Project available for PHP Developer (Web Development Job Offers)
- PHP/MySQL Programmer Position (Web Development Job Offers)
- Are you a PHP and Javascript junkie? It's time you met Emma. (Software Development Job Offers)
- PHP MYSQL Developer Position Available (Web Development Job Offers)
- PHP Web Programmer (Post your Resume)
- PHP / My SQL Web developer (Web Development Job Offers)
Other Threads in the C++ Forum
- Previous Thread: Just a plain push_back that blows off something
- Next Thread: C++ Client Help needed!
| Thread Tools | Search this Thread |
api array arrays based binary bitmap c++ c/c++ calculator char char* class code coding compile console conversion count data database delete deploy desktop developer dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






