第二个问题:
在表单中:post与get两个方法有什么区别?

解决方案 »

  1.   

    故障原因:使用了未经声明的变量
    说明:虽然php为了简化书写,在适当的配置下允许使用未经定义的变量。但这毕竟不是很严密的。
          所以在引用http变量时,最好先判断以下:
    if(isset($fiction))
    {
    echo "<br>fiction</br>";
    }
    if(isset($horror))
    {
        echo "<br>horror</br>";
    }
    解决办法:
    php.ini中error_reporting = E_ALL & ~E_NOTICE
    或在程序开头加上:
    error_reporting(E_ALL & ~E_NOTICE);
      

  2.   

    post和get是同属于http协议的两个不同的协议
    只要的不同点在于,get是显式的传递,且有2048字节的限制;post是隐式的传递,理论上无限制。
      

  3.   

    去看看http://expert.csdn.net/Expert/topic/2218/2218164.xml?temp=.8971979
      

  4.   

    谢谢唠叨
    对于只要的不同点在于,get是显式的传递,且有2048字节的限制;post是隐式的传递,理论上无限制。
    还是不大理解
    我写的两个程序文件a.html与b.php都不止2048字节,那她们怎么都可以传递?默认是get吧?
    我没改动呀
      

  5.   

    所谓显式的传递,是说参数的传递在URL中是显式的,如http://xxx.net/aaa.php?aParam=123,而隐式的话,aParam=123就不会显示出来,只是http://xxx.net/aaa.php
      

  6.   

    准确地说上传得是
    fiction=1&horror=1"
    默认我忘了
      

  7.   

    谢谢大家的帮助
    第三个问题:
    <?php
    $file="1.txt";
    $fp=fopen($file,"r") or die("the file is not exists");
    $file_size=filesize($file);   
    echo "the 18_2.php size is :".$file_size."<br>";  //输出10
    $chars=0;
    while(!(feof($fp)))
    {
    $fc=fgetc($fp);
    $chars=$chars+1;
    }
    echo "<br>the file total char is : $chars"; //输出11  
                                              //与filesize($file)的输出怎么不一样?
    fclose($fp);
    ?>还有我想问:一个换行符是2个字符吗?
    我的1.txt文件是三行只有6个字符呀
      

  8.   

    filesize 是文件大小
    $chars 是字符个数,两个没有可比性
      

  9.   

    哈哈,真是汗啊
    但我还是不明白以下三行:
    ab
    abc
    a
    ————————————
    while(!(feof($fp)))
    {
    $fc=fgetc($fp);
    $chars=$chars+1;
    }
    echo "<br>the file total char is : $chars"; //怎么会输出11  第四个弱智问题:<?php
    $fp=fopen("18_3.php","r") or die("the file is not exists");
    $file_size=filesize("18_3.php");
    echo "the file size is: $file_size<br>";
    $fs=fseek($fp, 22, SEEK_CUR) or die("you wrong"); //这怎么都定位不了?那里错了?
    $fstring=fgets($fp,5);
    echo "you get char is :$fstring";
    fclose($fp);
    ?>
    输出是:
    the file size is: 435
    you wrong
      

  10.   

    一个简单的办法
    {
    $fc=fgetc($fp);
    $chars=$chars+1;
    echo "第$chars个字符是$fc <br>";
    }$fs=fseek($fp, 22);
    if($fs == -1)echo "you wrong";
      

  11.   

    郁闷
    $fs=fseek($fp, 4, SEEK_CUR); //如果改成
                        //$fs=fseek($fp, 4, SEEK_CUR) or die("wrong")就输出wrong
    if($fs==-1)
    { echo "<br>you are wrong";}  //这里就没输出
    $fstring=fgets($fp,5);
    if(!$fstring){echo "<br>fgets() wrong";} //输出:fgets() wrong
    echo "<br>you get char is :$fstring";  //输出:you get char is :哪里出错了?最后才能得到正确的$fstring??
      

  12.   

    第五个问题:
    哪个大哥能讲讲pack()与unpack()函数
    书上只是点一下而已,不大懂
    最好举个小例子说说,谢谢