Kizel171
-
Posts
1 -
Joined
-
Last visited
Never
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
Creating a PHP file with PHP
in PHP Coding Help
Posted
The problem is when I go to create the $filedata varaible for fwrite() there is no way to put <?php into a string without having php start parsing the rest of the string.
I'm trying to do this...
$filedata = "
<html xmlns=\"http://www.w3.org/1999/xhtml\"> \n
<head> \n
<meta http-equiv=\"Content-Type\" content=\"text/html\; charset=iso-8859-1\" /> \n
<title>CACP</title> \n
</head> \n
\n
<body> \n
<?php \n
\$_SESSION[rem_dbhost] = $dbhost; \n
\$_SESSION[rem_dbname] = $dbname; \n
\$_SESSION[rem_dbuser] = $dbuser; \n
\$_SESSION[rem_dbpassword] = $dbpassword; \n
\n
header(\"Location: .\"\$_SERVER['DOCUMENT_ROOT'].\"/cedric/index.php\"); \n
exit; \n
?> \n
</body> \n
</html> \n ";
but if you print that variable back to the screen it returns a nice white nothing eventhough it is set when tested with isset().
I played around with commenting out different parts of the variable assignment to isolate the problem and its the <?php tag. As soon as that's gone then the string goes into the variable just fine.
Thanks in advance for suggestions.