アットウィキロゴ

PHP9000

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src='jquery.js'></script>     
<script src='pro.js'></script>
</head>
<body>
<p id='table'></p>
<textarea id="k"></textarea>
<input type="button" value="push" onClick="sample()" />
</body>
</html>
 
function sample(){
 
var urlx,word;
 
word=$("#k").val();
 
urlx ="ren.php?t="+word;
 
$.get(urlx, function (mdata) {
 
    var str;
    str = "1"+mdata;
 
    $("#table").html(str);
 
});
 
 
}
 
<?php
 
$word=$_GET["t"];
 
$fp = fopen("sample.txt", "a");
fwrite($fp, "\n");
fwrite($fp, $word);
fclose($fp);
 
$str="";
 
$fpx = fopen("sample.txt", "r");
while ($line = fgets($fpx)) {
$str=$str.$line;
}
fclose($fpx);
 
最終更新:2013年12月09日 15:30