I need someone who knows about Indy Components (delphi) and PHP
programming.
I use a TidTCPServer which is active at port 4250 listening 4
connections.
When i connect from another machine in my LAN, using PHP, the TCPServer
tells me, that's right...
The problem is when i want to read a text from the client (PHP).
TCPServer tells me that a message came, but it doesn't shw it to me.
Following is the code i use.
procedure TMainForm.TCPServerConnect(AThread: TIdPeerThread);
begin
MessageDlg('User has connected from web', mtInformation, [mbOK], 0);
end;
...
procedure TMainForm.TCPServerExecute(AThread: TIdPeerThread);
Var
Msg:String;
begin
{ Get the text sent from the client }
Msg := AThread.Connection.ReadLn;
MessageDlg('Message received: '+Msg, mtInformation, [mbOK], 0);
end;
...
This is PHP code (connect.php)
----------------
<?php
//try to connect to the TCPServer on 10.0.0.8
$fp = fsockopen("10.0.0.8",4250,&$errno,&$errstr,30);
//if can't connect, show error
if(!$fp) {
echo "Error connecting. Try later.";
echo "<br>$errstr ($errno)<br>\n";
}
else {
if (empty($field_msg)) {
echo "<form name=\"formsend\" method=\"post\" action=
\"connect.php\">Message: ";
echo "<input type=\"text\" name=\"field_msg\" size=\"30\"
maxlength=\"150\"><br>";
echo "<input type=\"submit\" name=\"submit\" value=\"Send
message\"></form>";
}
else {
echo "Message sent to Server!";
fputs($fp,$field_msg);
fclose($fp);
}
}
?>
...
Does anyone what may be wrong with this?
When user sends message from web i see the Server @ 10.0.0.8 showing me
a message dialog
---------------------
| Message received: |
---------------------
BUT I CAN'T SEE THE MESSAGE...
Sorry 4 long post. Thanks in advance.
----------------------------------
Henry - Argentina
http://www.quiquesistemas.com.ar
[EMAIL PROTECTED]
ICQ: 18048153
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php