> I am new to php, I would like to create a function that when called
> sends text from a text box as a query to a remote cgi script ,e.g
> http://www.anydomain.com/cgi-bin/script.cgi, and return the results as
a
>   variable so that i can echo the returned variable to an html page.

<?
$contents = "";
$text = "whatever...";

$ftext = urlencode($text);

$fp = fopen("http://www.example.com/cgi-bin/script.cgi?text="; . $ftext,
"r");

while($data = fread($fp,1000))
{ $contents .= $data; }

fclose ($fd);

?>

The response is now in $contents. Adapt to your needs. 

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to