Thanks John, See when i echo $contents, the page displayed contains backgrounds and other text from the remote site, how can i crop only the returned query and display it in a page with my backgrounds etc
thanks "John Holmes" <[EMAIL PROTECTED]> wrote in message 000a01c21aef$f58fc0a0$b402a8c0@mango">news:000a01c21aef$f58fc0a0$b402a8c0@mango... > > 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