Re: [PHP] Remote cgi script function

2002-06-24 Thread Haddad Said

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




Re: [PHP] Remote cgi script function

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 16:47, Haddad Said wrote:

 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

Short answer: with great difficulty.
Longer answer: use some form of regular expression to extract the bits that 
you need displayed.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
If parents would only realize how they bore their children.
-- G.B. Shaw
*/


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




[PHP] Remote cgi script function

2002-06-23 Thread Haddad Said

Hi,

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.

I would appreciate any help on this

Thanks




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




RE: [PHP] Remote cgi script function

2002-06-23 Thread John Holmes

 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