I have an fwrite()
function to create an email activation link. I need to use cookies for that link. First I enter:
if ($filecheck == "F") {
$file = $getuseremailresult['username'] . rand() . rand() . ".php";
$filename = "../" . $file;
$link = "http://new.connectionsocial.com/users/LoginRegisterName/" . $file;
$handle = fopen($file, "w") or die("<h1 style='text-align: center; color: red;'>There has been an error creating the activation link. Please try again later.</h1>");
$content = "
include_once('ConnectionDB.php');
$cookie = sha1($_COOKIE['TemporaryCookie']);
?>
";
fwrite($handle, $content);
mysqli_query($connection, "UPDATE userfilescheck SET FileCreated='T'");
}
And everything is fine so far. However, when I add in this to $content
:
$cookie = sha1($_COOKIE['TemporaryCookie'];
The entire page literally disappears, and none of the code works. Am I supposed to escape part of the $cookie
value, or is it just a parsing error?