English 中文(简体)
我为什么坚持“不存在直接关系?”
原标题:Why do I keep getting "directory does not exist?"
  • 时间:2010-01-26 03:21:29
  •  标签:
  • php

我不能说我在这里做的错。 我为编制档案而颁发的名录的许可,全都是书面许可。 我保留“不存在直接关系” 得到帮助!

<?
//creates variables and calls the information from the server
$Name = $_POST[ name ];
$desc = $_POST[ desc ];
$website =$_POST[ web ];
$email =$_POST[ email ];
$cname =$_POST[ cname ];
echo "your registered name is: ". $Name . ".<br/>";
echo "your registered description is: " . $desc . ".<br/>";
echo "your website address is: " . $website . ".<br/>";
echo "your Confirmation email has been sent to: " . $email . ".<br/>";

echo "your information has been stored, thank you! ";

$cname = trim($cname);

$filename = "data/clubinfo/$cname.txt";
$fp = fopen($filename, a );
fwrite($fp,$Name);
fwrite($fp,"
");
fwrite($fp,$email);
fwrite($fp,"
");
fwrite($fp,$desc);
fwrite($fp,"
");
fwrite($fp, $website);
fwrite($fp, "
");
fwrite($fp,"__");
fwrite($fp, "
");
fclose($fp);




 ?>
最佳回答

很可能,这本书对你自改过一条相对的道路以来所预想的工作目录持不同的看法。

更不用说绝对或至少与<代码>有关的道路。 即便是:

$filename = $_SERVER[ DOCUMENT_ROOT ] . "../data/clubinfo/$cname.txt";

这样做的好处是,它超越了你的文件根基,所以它直接靠你的网络服务器服务。 它还将不管贵国文字的位置如何工作,并且将不停在你安装网页的目录下工作,这可以成为与发展中国家和赞成部署的问题。

问题回答

现行目录中不存在<条码>/数据/代码>。

You need to create it first. (By hand or in PHP)
Alternatively, the current directory might not be what you think it is.

Try using file_put_contents() as this:

file_put_contents("data/clubinfo/$cname.txt", implode("
", $_POST));

如果你想按价值计算这一数值,你也应使用<代码>。 FILE_APPEND sign.

就像你没有走过根路,服务器正在从目前的地点寻找。 努力使这条道路偏离根基。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签