我想在一个.PHP文件中调用html的form标签,但是一直不行。代码如下:
<?php 
for($i=0;$i<3;$i++)
{?>
     <form name="form1" method="post" action="http://localhost/wordpress/?page_id=348" >
     <input type="submit" name="a" value=="<?php $i ?>" style= "width:100px;height:30px; ">   
     <input type="hidden" name="button1" value="<?php $i ?>">
     </form>
<?php}?> 以前没有接触PHP,这是第一次写PHP程序,请指教。

解决方案 »

  1.   

    <?php echo $i;?>不明白你写的啥
      

  2.   

    <form name="form1" method="post" action="http://localhost/wordpress/?page_id=348" ><?php  
    for($i=0;$i<3;$i++)
    {?>
        <input type="submit" name="a" value=="<?php $i ?>" style= "width:100px;height:30px; ">   
      <input type="hidden" name="button1" value="<?php $i ?>">
     <?php}?> 
     </form>
      

  3.   

    问题已经搞定,主要是格式问题,大家不需要明白这段代码是干吗的。重要问题格式问题已经标红。  
      <?php $i=0;?>
          <?php echo "<table border=0 cellspacing=50px><tr>"; ?>
           <?php while($i<$looptimes):
           ?>
            <?php echo "<td>"; ?>
             <form name="form1" method="post" action="http://localhost/wordpress/?page_id=348" >
             <input type="submit" name="a" value=<?=$i+1;?>  style= "width:80px;height:40px; ">   
             <input type="hidden" name="button1" value=<?=$i;?> > 
             </form>
            <?php echo "</td>"; ?>   
            <?php $i++; ?>
    <?php endwhile; ?>
    <?php echo "</tr></table>";?>