4.php
<?PHP
echo "hello, ".$_POST['name'];
?>
改成这样看看.

解决方案 »

  1.   

    看过了,就是不知道第一种方法为什么不行,大家帮忙啊,另外,大家看我这样写,她就是算不出来,units*price的值,显示是0,不知道是怎么回事
    <?PHP
    echo "hello, ".$_POST['name'];
    echo "你的花费是".$_POST['units']*$_POST['price'];
    ?>
      

  2.   

    第一种方法适合php.ini中register_globals设置为ON的时候用,默认是OFF,这是为了安全,所以不能接受到值。你的$_POST['units']和$_POST['price']是这个表单提交过来的吗?
      

  3.   

    嗯,对的,哦我知道了,把off改成on就可以了把下面那个是的,
    <form name="form1" method="post" action="4.php">
      <p> 
        <input type="text" name="name" id="name">
        name </p>
      <p> 
        <input type="text" name="units">
      units</p>
      <p>
        <input type="text" name="price">
      price</p>  <p> 
        <input type="submit" name="Submit" value="提交">
        <input type="reset" name="Submit2" value="重置">
      </p>
    </form>
      

  4.   

    成了,感谢大家,id="units"我没有写,原来是这个问题啊.