I am using php to create another .php file. I made it like so:
$file = fopen($Title . ".php" ,"w") or die("File Creation error: " . mysql_error());
$textToWrite =
"
<html>\n
<head>\n
<?php include("Header.php") ?>
</head>\n
//Body of the webpage
</html>\n
";
$textToWrite = htmlspecialchars($textToWrite);
fwrite($file, $textToWrite);
fclose($file);
where $Title is a non-empty variable.
I have come to see that htmlspecialchars does the exact oposite to what I want. Instead of converting the > and the < to > and < it does the oposite. Is there any other option because puting thr <?php dirrectly gives me a php error. Thank you.
I
Have you tried using html_entity_decode()?
http://ch2.php.net/manual/en/function.html-entity-decode.php