duandiao3961 2014-11-03 08:21
浏览 42

我想为每个单独的文本输入添加日期

<html>
<body>
<form name="form" method="post">
<input type="text" name="text_box" size="50"/>
<input type="submit" id="search-submit" value="submit" />

<?php
$date = 

$file=fopen(date("Y-m-d").".txt","a+") or exit("Unable to open file!");

if ($_POST["text_box"] <> "")
{
   fwrite($file,$_POST["text_box"]." 
");
}

fclose($file);
?>

Is there a way i can place a date for whenever there is an input?

Thanks guys in advance

  • 写回答

1条回答 默认 最新

  • dpuwov1487 2014-11-03 08:28
    关注

    Use this code

    $(document).ready(function(){
        $("input:text").val("<?php print date('Y-m-d');?>");
    });
    
    评论

报告相同问题?