Re: I need to pass vars to external cgi script ?
| From: | John Holmes | Date: | Sat, 11 Dec 2004 15:26:12 +0000 |
| Subject: | Re: I need to pass vars to external cgi script ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-204061@lists.php.net to get a copy of this message | ||
> From: "Dave Carrera" <dave@ephgroup.com>
> I need to send some vars to a cgi script.
>
> The script url is like this
>
>
> http://www.example.com/cgi-bin/script.cgi?var1=my_first_php_var;var2=my_seco
> nd_php_var and so on.
>
> How do I send / call this script from inside my php script ?
$file = fopen('http://www.example.com/cgi-bin/script.cgi?var1=my_first_php_var&var2=my_second_php_var&var3=...');
or
$file = fopen("http....script.cgi?var1=$phpvar1&var2=$phpvar2...");
although you'd want to urlencode() the PHP variables if you need something like the second
method.
---John Holmes...
UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html