Re: Getting a value back from POST (not the built-in return)

From: Date: Tue, 28 Jan 2003 16:58:50 +0000
Subject: Re: Getting a value back from POST (not the built-in return)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133401@lists.php.net to get a copy of this message
--- Paul <pauljwj@earthlink.net> wrote: > Using a fairly simple fsockopen and POST I'm sending > form data to a script which populates fields in a > database. Everything works fine, however I've been > trying to figure out how to send a value set on the > other machine (database) back through the open socket > (note: not the return value usually retrieved by > fgets($fp etc...) which is then available to the > sending machine. Searching via Google hasn't given me > an answer. > > Is it possible? Can somebody help? Syntax would be very > nice, I'm not a PHP guru. Anything that the receiving Web server outputs is sent back to you just as it would be a Web browser. So, you can read this data just as if from a file (which is why fsockopen is so convenient). Thus, just echo whatever you want to send back. You make a statement that is very conflicting: > I've been trying to figure out how to send a value set > on the other machine (database) back through the open > socket (note: not the return value usually retrieved > by fgets($fp etc...) So, you want to send data "back through the open socket", but you do not want read this data from the socket. I think you have a misunderstanding here somewhere that will make things difficult for you. What fgets() gives you *is* the data sent from the remote server. If you want to pass data back in a manageable way, you will probably want to output XML, because that is easier and more reliable to parse than HTML. Chris

« previous php.general (#133401) next »