ぐるなびapiで取得した情報の一つ一つ(例〇〇カフェや◯◯バー)にコメントフォームを追加したいのですが、コメントフォームのコードの基本はわかるのですがapiから取得した情報と統合できていないんです。つまり、コメントフォームのコードをphpに書いても一つのコメントフォームしか出てきません。複数のコメントフォームを複数の情報に追加したいのですが詳しいやり方がわかりません。
下記がコメントフォームのコードです。
html
1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 4<title>sample</title> 5</head> 6<body> 7<form action="regist.php" method="post"> 8 名前:<br /> 9 <input type="text" name="name" size="30" value="" /><br /> 10 メールアドレス:<br /> 11 <input type="text" name="mail" size="30" value="" /><br /> 12 コメント:<br /> 13 <textarea name="comment" cols="30" rows="5"></textarea><br /> 14 <br /> 15 <input type="submit" value="登録する" /> 16</form> 17</body> 18</html>
そして下記がapiのコードの一部です。
PHP
1<?php 2$apikey='私のid'; 3$format='xml'; 4$hit_per_page='50'; 5$pref='PREF13'; 6$url ='http://api.gnavi.co.jp/RestSearchAPI/?keyid=' . $apikey . '&format=' . $format . '&pref=' . $pref . '&hit_per_page=' . $hit_per_page; 7 8 $xml = simplexml_load_file( $url ); 9 10・・・・ 11・・・・ 12・・・・ 13
apiのコードの上にコメントフォームのコードを書きました。
あなたの回答
tips
プレビュー