-2

我想将单选按钮的 onclick 事件链接到新网页。网页是用php开发的,语法如下

echo """<input class="radio" type="radio" name="alg_Type" id="HP" value="HP" onclick="location.href='highP.php'"/>  <label class="choice" for="HP">High precision</label>""";

我收到以下错误解析错误:解析错误,期待','' or';''

任何帮助,将不胜感激。

谢谢

4

3 回答 3

1
echo '<input class="radio" type="radio" name="alg_Type" id="HP" value="HP" onclick="location.href=\'highP.php\'"/>  <label class="choice" for="HP">High precision</label>';
于 2012-07-03T15:36:30.127 回答
0

你严重滥用引号。尝试:

<?php 
  //some code
  ?>
  <input class="radio" type="radio" name="alg_Type" id="HP" value="HP" onclick="location.href='highP.php'"/>
  <label class="choice" for="HP">High precision</label>
  <?
  //more php code
于 2012-07-03T15:36:37.420 回答
0

尝试 :

echo '<input class="radio" type="radio" name="alg_Type" id="HP" value="HP"  onclick="location.href=\'highP.php\'"/>  <label class="choice" for="HP">High precision</label>';
于 2012-07-03T15:37:09.953 回答