麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
一个ajax问题。带2个源文件!
悬赏分:20 - 2007年08月18日

l.php 文件如下:
[PHP]

<?
@header("Content-type: text/html; charset=utf-8");


function GetLicense (){
/**
* 这里是获得服务器返回资料!
*/
$Server = $_SERVER[HTTP_HOST]=='127.0.0.1' ? "localhost" : $_SERVER[HTTP_HOST] ;
$DateIs = date("Y-m-d",time());
$Script = "";
$Script .="
<script language=\"JavaScript\">

function GetResult(hostname,TheDate)
{

if (window.XMLHttpRequest) { // Mozilla, Safari, ...
http_request = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
http_request = new ActiveXObject(\"Microsoft.XMLHTTP\");
}
var linkurl=\"http://localhost/s.php?serverhost=\"+hostname+\"&DateIs=\"+TheDate;
//alert(linkurl);
http_request.open('GET',linkurl,false);
http_request.send(null);

//通过XMLHTTP返回数据,开始构建Div.
//var returntxt=unescape(http_request.responseText)
var returntxt=http_request.responseText;
alert(returntxt);
BuildArrib(returntxt);

}

function BuildArrib(txt)
{
ajax_license.style.display='';
document.getElementById('ajax_license').innerHTML = txt;
}
</script>



<script language=javascript>
GetResult('$Server','$DateIs');
</script>
";
return $Script;
}
echo GetLicense();

?>
[/PHP]

s.php 如下:
[PHP]
<?php
error_reporting(7);
@header("Content-type: text/html; charset=utf-8");

$TheError_txt = "
\"http://www.w3.org/TR/html4/loose.dtd\">



SmartShop


$TheError

";


function file_write($filename, $flag, $content) {

if (file_exists($filename)) {
if (!is_writable($filename)) {

if (!chmod($filename, 0777)) {
$TheError = "Cannot change the mode of file ($filename)";
return $TheError;
};
}
}

if (!$fp = @fopen($filename, $flag)) {
$TheError = "Cannot open file ($filename)";
}

if (fwrite($fp, $content) === FALSE) {
$TheError = "Cannot write to file ($filename)";
}
if (!fclose($fp)) {
$TheError = "Cannot close file ($filename)";
}
return $content;
}


echo file_write("1.txt","w",$TheError_txt);

?>

[/PHP]

现在我的问题是。我没有办法运行l.php后,使得建立1.txt 文件。请问为什么!!

提问者:大白菜芯   08-18 14:02
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
80 + 27 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM