PHP Save txt file Getting Started tutorial examples

Source: Internet
Author: User

<style type= "Text/css Tutorial" >
<!--
. {font-family: "Song Body"; Font-size:9pt;color: #000000}
-->
</style>
<body bgcolor= #cccccc >
?
if ($nickname = = "") {
Print "<center><b><font color= #FF99FF > topic? </font>
";
}
else if ($key = = "") {
Print "<center><b><font color= #FF99FF > keywords? </font>
";
}
else if ($note = = "") {
Print "<center><b><font color= #FF99FF > content? </font>
";
}else{
print "<p></p>";
$t = Date (Y-year m-month D-day);


$note = Str_replace ("<", "<", $note);
$note = Str_replace (">", ">", $note);
$note = Str_replace ("n", "
", $note);

$main = "<title>untitled document</title>

<meta name= "key" content= $key >
<meta name= "NAME" content= $nickname >

<body bgcolor= "#E1F0E9" >
<table width= "border=" "0" align= "center" cellspacing= "1" cellpadding= "0" bgcolor= "#006633" >
<tr bgcolor= "#E0F0E8" >
<TD height= ><!--topic start--> $nickname <!--topic end--></td>
</tr>
<tr bgcolor= "#E0F0E8" valign= "Top" >
<TD height= "338" ><!--body start--> $note <!--body End--></td>
</tr>
</table>
</body>
";

$FDD =fopen ("Count.txt", "R");
$CDD =fread ($FDD, 5);
$CDD + +;
Fclose ($FDD);
$FDD =fopen ("Count.txt", "w");
Fwrite ($FDD, $CDD);
Fclose ($FDD);
$TTT = ". html";
$n = $CDD. $ttt;
$f = fopen ($n, "a");
Fwrite ($f, $main);
Fclose ($f);
Print "<center><b><font color= #FF99FF > Submit Success </font>
";


}
?>

<p>
</p>
<p>
</p>
<center><a href= "input.php" > Return </a></center>

</center>
</body>

<title>untitled document</title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

<body bgcolor= "#006633" >
<form method= "POST" action= "result.php" >
<table width= "720" border= "0" align= "center" bgcolor= "#D2E7D1" >
<tr>
<td> title:
<input type=text name=nickname size= ">"
</td>
</tr>
<tr>
<td> Keywords:
<input type=text name=key size= ">"
</td>
</tr>
<tr>
<td>
<div align= "center" >
<p> text:


<textarea name=note cols= "rows=" ></textarea>
</p>
</div>
</td>
</tr>

<tr>

<TD width=80% align=center><input type= "Submit" value= "OK" ><input type= "reset" value= "rewrite" >
</td>
</tr>

</table>
</form>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.