ホットペーパーapiのパラメータに検索用予算のbudgetがあります。これをセレクトボックスに使いのですが、どこか間違っているみたいで使えません。下記のコードで何か間違いはありますか?
※レスポンスパラメータは省略します。
html
1<html> 2<head> 3<title>API_SAMPLE</title> 4</head> 5<body> 6 <form method="POST"> 7 <select name="budget"> 8 <option value="1001〜2000">1001〜2000</option> 9 <option value="2001〜3000">2001〜3000</option> 10 <option value="3001〜4000">3001〜4000</option> 11 12 </select> <input type="submit" name="search" value="検索"> 13 </form> 14</body> 15</html>
PHP
1<?php 2$key='私のキー'; 3$count='20'; 4$large_area='〇〇'; 5$start ='1'; 6$budget=$_POST ["budget"]; 7$format='xml'; 8$url='http://webservice.recruit.co.jp/hotpepper/gourmet/v1/?key='.$key.'&count='.$count.'&large_area='.$large_area.'&start='.$start.'&budget='.$budget. '&format='.$format; 9$xml=simplexml_load_file($url); 10
回答4件
あなたの回答
tips
プレビュー