Php file\u put\u content()方法不起作用

Php file\u put\u content()方法不起作用,php,mysql,Php,Mysql,因为函数put不会返回任何数据。它将文本写入输出,但不返回任何内容。因此,不会将任何内容写入该文件。在此处了解函数返回值: 此外,我认为“'$GLOBALS[str]'/index.php”不是有效的文件名。$data=“your data” $file=uniqid()..php'//如果不想创建文件,可以使用现有文件 $success=文件内容($file$data) <?php function put() { $result = mysql_query("SELECT *

因为函数
put
不会返回任何数据。它将文本写入输出,但不返回任何内容。因此,不会将任何内容写入该文件。在此处了解函数返回值:

此外,我认为
“'$GLOBALS[str]'/index.php”
不是有效的文件名。

$data=“your data”

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

$success=文件内容($file$data)

<?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());