File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 140140 }
141141 else {
142142 echo "
143+ <h2>Edit <tt> $ title</tt></h2>
143144 <center>
144- <h2> $ title</h2>
145145 <form action= \"update.php?id= " .$ pid ."\" method= \"post \">
146146 <br>
147- <textarea name= \"val \" rows= \"20 \" cols= \"80 \"> $ title \n$ edpg</textarea>
147+ Title:
148+ <input name= \"tit \" value= \"$ title \" type= \"text \"><br><br>
149+ <textarea name= \"val \" rows= \"20 \" cols= \"80 \"> $ edpg</textarea>
148150 <br><br>The title of the note is on <B>line 1</B><br><br>
149151 <input type= \"button \" onclick= \"javascrtpt:window.location.href='/?type=view&id= $ pid' \" value= \" < Back \">
152+ $ share
150153 <input type= \"submit \" value= \" > Save \">
151154 </form>
152155
Original file line number Diff line number Diff line change 11<?php
22echo "<title>Updating</title> " ;
33$ id =$ _GET ['id ' ];
4+ $ tit =$ _POST ['tit ' ];
45$ val =$ _POST ['val ' ];
56$ f =fopen ("doc/ " .$ id .".md " ,"w " );
6- fwrite ($ f ,trim ($ val ));
7+ fwrite ($ f ,trim ($ tit ). "\n" . trim ( $ val ));
78fclose ($ f );
89echo "<script>window.location.href= \"/?type=edit&id= " .$ id ."\";</script> " ;
910?>
You can’t perform that action at this time.
0 commit comments