Home  >  Article  >  Backend Development  >  批改程序 用户没有修改数据时不更新txt文件

批改程序 用户没有修改数据时不更新txt文件

WBOY
WBOYOriginal
2016-06-13 11:53:47832browse

修改程序 用户没有修改数据时不更新txt文件
再退回首页前,用户无论是否修改数据都要点保存,我设置了js提示,但是万一点错,数据就全没了,我想只在文件里写入修改的数据,若是判断数组的该值为空则不执行fwrite,但是行不通,求大牛之指教

<?php <br />error_reporting(4);<br>?><br><div>
<br><table>
<br><form>
<br><thead><br></thead>
<br><tbody>
<br><tr>
<br><th>Segment</th>
<br><th>Function</th>
<br><th>2014&nbsp </th>
<br><th>2015&nbsp </th>
<br><th>2016&nbsp </th>
<br><th>2017&nbsp </th>
<br><th>2018&nbsp </th>
<br>
</tr>
<br><?php <br />$filename="AAPvaleurs.txt";<br>$file_hwnd=fopen($filename,"r");<br>$content = fread($file_hwnd, filesize($filename));  <br>fclose($file_hwnd);<br>$AAP2 = unserialize($content); <br>?><br><tr>
<br><td>Premium</td>
<br><td>Product Line</td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br>
</tr>
<br><br><br><tr>
<br><td>Premium</td>
<br><td>Design</td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br>
</tr>
<br><br><br><br><tr>
<br><td>Value</td>
<br><td>Technology Eng</td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br>
</tr>
<br><tr>
<br><td>Value</td>
<br><td>Simulation</td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br>
</tr>
<br><br><tr>
<br><td>Base</td>
<br><td>IMDS</td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<br><td>
<input> ></td>
<div class="clear">
                 
              
              
        
            </div>
</tr>
</tbody>
</form>
</table>
</div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn