Vince LaMonica wrote:

I wish to use fwrite() to create a small PHP file. So far, when I attempt
to do this, php parses the contents of the file that fwrite needs to
create. Eg, I have this:

$new_id = mysql_insert_id();
// create brand new file
$new_file = fopen("/var/www/html/$sitename/$submitted_url", "w");
$new_file_content = "\n"
." <?php \n"
." if ($_GET['preview'] == \"y\") { \n"

You need to escape the dollar signs in your string.


." if (\$_GET['preview'] == \"y\") { \n"

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to