我的代码是不runnig。如何在PHP上以$ _POST的形式传递变量。还是不可能?
原代码
foreach ($ret[0]->trends as $topic) {
$a = $topic->name;
$a = preg_replace("'", " ", $a);
$i++;
echo "
<tr>
<td class='hidden-xs'>$i</td>
<td>$topic->name</td>
<td><form role='form' action='/trgy/follow.php' method='get'>
<input type='text' name='$a' placeholder='follow number' >
<input type='submit' value='Follow'></form>
</td>
</tr>";
$count = htmlspecialchars($_POST[$a]);
if (!empty($_GET[$topic->name])) {
$ret1 = $topic->name;
$lasttweets = $connectionOauth->get('search/tweets', array('q' => $ret1, 'count' => $count));
}
}
不运行 - 这个有问题的线 - 我不能指望
$a = $topic->name;
<input type='text' name='$a' placeholder='Number' >
$count = htmlspecialchars($_POST[$a]);
那是什么代码? PHP或HTML?在这两种情况下,这里是标签? – YounesM
使用php标记和表单 –
如果使用正确的标记,则可以使用。 – Jer