呵呵,,你设置了disabled就不会把数据提交到服务器
可以在提交前用脚本改回来...

解决方案 »

  1.   

    在xitongok.php页面把$servername抛出来看看
      

  2.   


    <script language="javascript">
    function init(){
     lock(document.getElementById('chkLock'))
        t=document.location.hash.replace('#','');
        if(t=='')t=1;
        switchTag('tag'+t,'content'+t);
    }
        function onSubmit(){
    if(!document.getElementById("chkLock").checked){
    document.getElementById("chkLock").click();
    }
    return true;
        }
        function lock(obj){
            var inputs = document.admin.getElementsByTagName("input");
            for(var i=0; i<inputs.length; i++){
                if(inputs[i].type == "text"){
                    inputs[i].disabled = !obj.checked;
                }
            }
        }
        window.onload = function(){
            document.getElementById("chkLock").checked = true;
            document.getElementById("chkLock").click();
        }</script>
    <body onload="init()">
    <tr><FORM name="admin" method="post" action="xitongok.php">
              <?php
                        $fp= fopen("/www/imgserver/setting.cfg","r");
                        fscanf($fp,"[network]");
                        fscanf($fp,"nic=nic0");
                        fscanf($fp,"[nic0]");
                        fscanf($fp,"dhcp=%s",$dhcp);
                        fscanf($fp,"ip=%s",$ip);
                        fscanf($fp,"mac=00-0C-E0-F0-3C-0F");
                        fscanf($fp,"netmask=%s",$netmask);
                        fscanf($fp,"gateway=%s",$gateway);
                        fscanf($fp,"[server]");
                        fscanf($fp,"name=%s",$servername);
                        fscanf($fp,"[control]");
                        fscanf($fp,"restart=0");
                                            fclose($fp);
                      ?>
                      <?php echo $dhcp?>
                  <td height="125" ><table width="87%" height="73" border="0" align="center" cellpadding="0" cellspacing="1">
                    <tr><input type="checkbox" value="1" id="chkLock" onclick="lock(this)" name="chkLock" /><label for="chkLock">手动设置</label>
                      <td width="44%" height="24" align="right" >IP地址:</td>
                            <td width="56%" align="left" ><input name="ip" type="text"  id="ip" value="<?php echo $ip?>" onBlur="check_ip(this.value)"/></td>
                    </tr>
                                    <tr>
                      <td width="44%" height="24" align="right" >子网掩码:</td>
                            <td width="56%" align="left" ><input name="netmask" type="text"  id="netmask" value="<?php echo $netmask?>" onBlur="check_ip(this.value)"/></td>
                                    </tr>
                                    <tr>
                      <td width="44%" height="24" align="right" >默认网关:</td>
                            <td width="56%" align="left" ><input name="gateway" type="text"  id="gateway" value="<?php echo $gateway?>" onBlur="check_ip(this.value)"/></td>
                    </tr>
                    <tr>
                      <td height="24" align="right" >服务器别名:</td>
                            <td align="left" ><input name="servername" type="text" id="servername" value="<?php echo $servername;?>" /></td>
                    </tr>
                  </table>
                  <table width="87%" height="24" border="0" align="center" cellpadding="0" cellspacing="1">
                        <tr>
                          <td height="25" align="center" ><input name="tijiao" type="submit" class="btn" border="0" value="确 定" onclick="onSubmit();">
                            </td>
                        </tr>
                    </table></td></FORM>
      

  3.   

    你的$servername 有值么?打出来看看