【发布时间】:2014-03-06 12:09:14
【问题描述】:
我想为从下拉列表中选择的特定选项请求特定网页内容。
在我的示例中,我想要社区和级别是两个下拉列表的网页中的内容。我想要选项Community='SoftwareFactory/Cloude' 和Level='V6R2015x' 的网页。
我的代码是
<?php
// init the resource
$ch = curl_init('http://e4allds/');
// set a single option...
$postData = array(
'Community' => 'SoftwareFactory/Cloud',
'Level' => 'V6R2015x'
);
curl_setopt_array(
$ch, array(
CURLOPT_URL => 'http://e4allds/',
CURLOPT_POSTFIELDS => $postData,
//OPTION1=> 'Community=SOftwareFactory/Cloud',
//OPTION2=> 'Level=V6R2015x',
CURLOPT_RETURNTRANSFER => true
));
$output = curl_exec($ch);
echo $output;
但它给出了默认选择的结果。谁能帮助我如何将这些参数传递给 URL?
【问题讨论】: