2014-11-03 19 views
-1
<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"]." \n"); 
} 

fclose($file); 
?> 

有沒有一種方法,我可以爲每當有輸入一個日期?提前我想添加一個日期到每個單獨的文本輸入

謝謝你們

+0

地點的日期在哪裏?請更具體一些。 – EternalHour 2014-11-03 08:23:23

+0

小心分享你的意圖?什麼是更大的目標?將日期添加到文本輸入可能有更好的方法。 – Paul 2014-11-03 08:23:25

+0

我想要做的是添加像有人發送此輸入時的時間框架。這行完全是fwrite($ file,$ _ POST [「text_box」]。「\ n」); – TattooOG 2014-11-03 18:37:39

回答

-1

使用此代碼

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

這究竟是在代碼中去?對不起,對於PHP提前感謝的新的愚蠢的問題。 – TattooOG 2014-11-06 19:48:56

相關問題