Okey, sorry about that.
Communicating with a servlet via http is not different from other
php-http-methods:
For example:
# First declare some parameters which shall be sent to the Servlet/JSP
$eqid = '1';
$oparameter = 'tablist';
$nocolumn = '1';
$request = '?eqid=' . urlencode($eqid);
$request .= '&oparameter=' . urlencode($oparameter);
$request .= '&nocolumn=' . urlencode($nocolumn);
# Then it is just a simple as reading a file via http (NOTE! the client does
not care whether it is a file or a stream)
# To be able to access the server I must also submit a userId and a pwd.
$elements =
file("http://userid:[EMAIL PROTECTED]/servlets/XQuery".$request);
Then all you have to do is to iterate the returned array (there are many way
ie: for ($i = 0; $i < sizeof($elements); $i++)).
If you want to split the stream with a RE you can try to use a method like
this one:
function readandsplit($filename, $separator) {
$fd = fopen($filename, "r");
$contents = "";
$chunksize = 1000;
do {
$tmpstr = fread ($fd, $chunksize);
$contents = $contents.$tmpstr;
} while (strlen($tmpstr) == $chunksize);
fclose($fd);
# And for example use the preg_split-method which takes the RE and splits
the string
$elements=preg_split($separator, $contents);
return($elements);
}
By from Stockholm, Sweden!
/ Jeppe
Krznaric Michael <[EMAIL PROTECTED]> skrev i
diskussionsgruppsmeddelandet:81A3043681E6824EBE672F7421C30E7E2A1952@SRVTORON
TO.RAND.COM...
So tell us?
Mike
-----Original Message-----
From: Jesper Blomstrm [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 4:51 PM
To: [EMAIL PROTECTED]
Subject: SV: [PHP] PHP vs Servlet
I found out how to do it.
Thx anyway
/ J
Jesper Blomström <[EMAIL PROTECTED]> skrev i
diskussionsgruppsmeddelandet:[EMAIL PROTECTED]
> Hi!
>
> I am sure you have a solution to this...
>
> How shall I communicate with a servlet from PHP?
> I have a servlet which makes a DB-query and returns the
> result.
>
> Thanks!
>
>
>
> / Jeppe
>
>
>
> --
> Jesper Blomström
> [EMAIL PROTECTED]
> Arbete: 08-566 280 08
> Hem: 08-669 23 10
> Mobil: 070-30 24 911
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]