当前位置: 代码迷 >> PHP >> 还是不行大神们,救救小弟我吧
  详细解决方案

还是不行大神们,救救小弟我吧

热度:95   发布时间:2016-04-28 18:40:45.0
还是不行大神们,救救我吧
<?php
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
$date = date('H:i, js F Y');
?>

<html>
<head>
  <title>Sportman - Order Results</title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body>
<h1>Sport</h1>

<?php

$outputstring =“nihao31456”
//open file for write
$fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt",'a');
//flock($fp, LOCK_EX);
if (!$fp){
echo "<p><strong>提交失败/strong></body></html>";
exit;


fwrit($fp, $outputstring, strlen($outputstring));
flock($fp, Lock_UN);
fclose($fp);

echo"<strong>OK^_^<strong>";
}
?>
</body>
</html>


还是出现提交失败啊
使用
echo "$DOCUMENT_ROOT/../orders/orders.txt"
显示/home/wwwroot/default/../orders/orders.txt
证明路径没错啊

并且$fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt",'a');
[email protected],应该有错误提示的也没有啊



求大神,解决下 啊,几个小时了,还没搞定
------解决方案--------------------
$path=realpath('/home/wwwroot/default/../orders/orders.txt');
var_dump($path);
看看这个的结果是什么。
  相关解决方案