this is the PHP coding for sending the binaries code
-----------------------------------------------------
CODE
<html>
<head>
<title>sending1</title>
</head>
<body>
<h1>sending data</h1>
<?php
echo exec('C:\apache\php\executable\run.exe'); /* getting data from c++*\
?>
<?
$B1=$_REQUEST["B1"];
print "<h3>sending, $R1!</h3>";
?>
<br>
<input type="SUBMIT" value="REFRESH" name="B1">
<META HTTP-EQUIV=Refresh CONTENT="3; URL=http://localhost/new_page_4.htm">
</form>
<?php
$num=$R1;
echo decbin("$num") . "<br />"; //convert into binary data
print "$num";
?>
</body>
</html>
----------------------------------------------------------------------
the above program works and the coding in the c++ is:
----------------------------------------------------------------------
CODE
#include <iostream.h>
void main()
{
cout<<"Hello World"<<endl;
}
return 0;
}
-----------------------------------------------------------------------
the PHP are able to show "Hello World" in the browser. But I dont know how to show the data from PHP into C++. I tried to look up some refference but I can hardly found anything..n now I wonder whether this would work or not..but some resource asked me to use:
stdin>>unsigned int-----------------------------------------------------------------------
I tried together with the setting the baud rate, handshaking for C++, etc too. but seems something is missing. I need the C++ so the it will transfer the data to the serial port because the PHP cant transfer the data straight to serial port.
any help is so much appreaciated.
thank you.
This post has been edited by Dark_Nexus: 1 Oct, 2006 - 02:22 PM