Jump to content

Fwrite Problem


Cod-nes

Recommended Posts

How do I write this into a file?

<?php$file=fopen("config.php","w");$pass=md5($ap);$info="<?phpfunction showfooter(){$copy=true;$title=\"test\";$aq=\\"http:\/\/test\\";if($copy=true){echo \"Powered by <a href=\\"$aq\\">Something</a> - Something 2009\";}else {echo "something here";if(file_exist(\"footer.php\")){include(\"footer.php\");}}}?>"fwrite($file,$info);$fclose($file);?>

(Only a part of the file.)As you can see I need another slash. Two of these: \\. But they cancel themselves out or something that I get Parse error: syntax error, unexpected T_VARIABLE on the line of: $aq=\\"http:\/\/test\\";

Link to comment
Share on other sites

Tried that.

echo \"Powered by <a href=\"$aq\">Something</a> - Something 2009\";

It appears like this in config.php

echo "Powered by <a href="$aq">Something</a> - Something 2009";

Then I get a error that wrong use of echo or something.

Link to comment
Share on other sites

It works. Thanks. ^^ The file config.php gets created perfectly but there's this strange problem when I fwrite the infomation to the file. I get "Fatal error: Call to undefined function: ()". Is there a way to stop functions from running when we fwrite them into files?

Link to comment
Share on other sites

What line does it say the error is on?Also, you have a logic error in this code:

if($copy=true)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...