如何将 HTML 文件内容从 PHP 传递到 CGI (Perl) 脚本
PHP 生成的 HTML 文件的内容存储在名为“
$output
我正在尝试将 $output 中的内容发送到 CGI 脚本”的字符串变量中。
我在 PHP 中尝试了以下 CURL...
$output = "long string, with strange non HTML characters..."
$c = curl_init();
curl_setopt($c, CURLOPT_URL, 'http://www.example.com/cgi-bin/script.cgi');
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $output);
curl_exec ($c);
curl_close ($c);
...但我只得到了 $output 内容的一小部分。
您对如何将 $output 的内容从 PHP 传递到 CGI/Perl 脚本有什么建议吗?
谢谢!
The content of the an HTML file generated by a PHP is stored in a string variable called
$output
I am trying to send the contents in $output to a CGI script.
I have tried the following CURL in PHP...
$output = "long string, with strange non HTML characters..."
$c = curl_init();
curl_setopt($c, CURLOPT_URL, 'http://www.example.com/cgi-bin/script.cgi');
curl_setopt($c, CURLOPT_POST, true);
curl_setopt($c, CURLOPT_POSTFIELDS, $output);
curl_exec ($c);
curl_close ($c);
...but I only get a small part of the $output content.
Do you have any recommendations on how to pass the content of $output from PHP to the CGI/Perl script?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道它是否适合您,但您可以这样做:
这会将您的数据作为名为“output”的 POST 字段的值发送
您还可以使用套接字函数打开与服务器的连接并发送您自己的完全自定义的 http 请求。
I don't know if it suits you but you can do that:
This will sent your data as value of the POST field named 'output'
You may also use socket functions to open connection to server and send your own fully custom http request.