2013-02-18 120 views
-2
<?php 
function put() 
    { 
$result = mysql_query("SELECT * FROM members WHERE Website_Name = '$GLOBALS[str]'") or die(mysql_error()); 
?> 
<div id='container' style='width:100%'> 
<style> 
h1 {font-size:45px;} 
</style> 
<div id='header' style='background-color:#FFFFFF;'> 
<h1 style='margin-bottom:0;margin-top:0;height:20%;float:center;'> 
<?php 
while($row = mysql_fetch_array($result)) 
{?> 
<table align='left'><tr><td><img src="$row[Website_Name]/index.jpg" align='center' width='240' height='170'></td></tr></table> 
<table align='center'><br><tr><td><h1>"$row[Business_Name]"</td></tr></table> 
<?php 
} 
?> 

file_put_contents("'$GLOBALS[str]'/index.php",put()); 

我正在使用file_put_contents()方法..但它没有将数据写入文件。file_put_content()方法不起作用

回答

0

$ data =“your data”;

$ file = uniqid()。'。php'; //如果你不想创建文件,你可以使用你现有的文件。

$ success = file_put_contents($ file,$ data);