這篇文章主要為大家詳細介紹了ph??p實(shí)現記事本案例,實(shí)事本文中示例代碼介紹的現記非常詳細,具有一定的案例參考價(jià)值,感興趣的實(shí)事本小伙伴們可以參考一下
本文實(shí)例為大家分享了php實(shí)現記事本的具體代碼,供大家參考,現記具體內容如下
記事本案例
2)用戶(hù)在文本域中輸入內容??后,實(shí)事本點(diǎn)擊發(fā)表按鈕,現記會(huì )以當天的案例日期和時(shí)間創(chuàng )建一個(gè)記事本,并將用戶(hù)輸入的實(shí)事本內容保存到記事本中
效果:
代碼:
<style>
textarea{
reヽ(′▽?zhuān)?ノsize: none;
border: 2px solid #000;
outline: none;
}
input{
margin-top: 15px;
width: 80px;
height: 30px;
border: none;
outline: no??ne;
color: #fff;
ba??ckground-col(′▽?zhuān)?or: orange;
}
<ヾ(′?`)?;/style>
<form action='4.ph(′?_?`)p' method="post">
<textarea name='text' id="" cols='30??' rows='10'></textarea>
<div>(╯°□°)╯︵ ┻━┻<input type="submit" name="btn" value='發(fā)表'></div>
</??form>
<?php
// 方法一
$file=$_POST['text??'];
$filename = date('Ymd',time()).'.txt';
$fhヾ(′?`)?=fopen($filename,'a');
fwrite($fh,$fi(′▽?zhuān)?)le);
fclose($fh);
// 方法二
// file_put_contents('1.txt',$file);
?>
拓展知識點(diǎn):
以上ヽ(′▽?zhuān)?ノ就是本文的全部?jì)热?,希望對大家的現記學(xué)習有所幫助,也希望大家多多支持腳本之家。案例
實(shí)事本來(lái)源:腳本之家
實(shí)事本鏈接:http(′?_?`)s://w??ww.jb51.net/article/197744.htm
實(shí)事本Copyright ? 2012-2018 天津九安特機電工程有限公司 版權所有 備案號: