Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,396 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 2,108 people online right now. Registration is fast and FREE... Join Now!




fetching data from external source

 
Reply to this topicStart new topic

fetching data from external source, Im so new with C++ and I have to make the C++ fetch binaries data from

shareena
30 Sep, 2006 - 08:28 AM
Post #1

New D.I.C Head
*

Joined: 30 Sep, 2006
Posts: 1


My Contributions
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
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 02:55AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month