アットウィキロゴ

phpふぃぇ

function sample(){
 
var urlx,word;
 
word=$("#k").val();
 
urlx ="ren.php?t="+word;
 
$.get(urlx, function (mdata) {
 
    var str = mdata.split("△");
    var s;
    var memo;
    memo = "<table>";
    for (s = 0; s < str.length;s++ ){
    memo=memo+"<tr>";
    memo=memo+"<td>";
    memo=memo+str[s];    
    memo=memo+"</td>";   
    memo=memo+"</tr>";
    }
 
        memo = memo + "</table>";
 
 
 
    $("#table").html(memo);
 
});
 
 
}
 
<?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."△";
$str=$str.$line;
}
fclose($fpx);
 
print($str);
 
?>
 
 
<!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>
 
最終更新:2013年12月09日 15:46