0
這是API的GetResponse的爲https://github.com/robertstaddon/GetResponse-PHP-Wrapper/blob/master/PHPwrapper/GetResponseAPI.class.php GETRESPONSE使用API來獲取競選
if(isset($_POST['Generate']))
{
require_once dirname(__FILE__) . '/GetResponseAPI.class.php';
$api = new GetResponse('APIKEY HERE');
$campaigns = (array)$api->getCampaigns();
$campaignIDs = array_keys($campaigns);
$campaign = $api->getCampaignByID($campaignIDs[0]);
var_dump($campaigns, $campaign);
}
這是HTML代碼是用PHP在同一頁上的主要環節。
<form method="post" action="">
<select name="Campaign" id="Campaign">
<?php foreach ($campaign as $campaignID => $value) { ?>
<option value="<?php echo $campaignID;?>"><?php echo $value;?></option>
<?php } ?>
</select>
<input type="submit" value="Generate" name="Generate" id="Generate"/>
</form>
我在同一頁的頂部得到林的錯誤是以下內容: 陣列(0){} NULL