function sample(){
var cc=document.cookie;
cc = cc + "600";
if (cc == "600") document.cookie =f();
$("#memo").html(document.cookie);
$("#memo").click(function () {
urlx="play.php?code="+document.cookie+"&x="+1;
$("#memo").load(urlx);
});
}
function f(){
str = "";
for(s=1;s<11;s++){
str=str+randabc();
}
return str;
}
function randabc(){
n1=5*Math.random();
n2=Math.floor(n1)+1;
cc = "";
if (n2 == 1) cc = "a";
if (n2 == 2) cc = "b";
if (n2 == 3) cc = "c";
if (n2 == 4) cc = "d";
if (n2 == 5) cc = "e";
return cc;
}
<?php
$x=$_GET["x"];
$code=$_GET["code"];
$memo="";
$fp = fopen("data.txt", "r");
while ($line = fgets($fp)) {
$memo=$memo.$line;
}
fclose($fp);
$memo=$memo."p".$code.",".$x;
$fp2 = fopen("data.txt", "w");
fwrite($fp2,$memo);
fclose($fp2);
print("Thank you.");
?>
最終更新:2015年10月24日 17:00