PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$body = "This is the body";
$filename = 'input.html';
$somecontent = "<html><body><b>First Name:</b> $technicalfirstname<br></body></html> ";
$handle = fopen($filename, 'w');
fwrite($handle, $somecontent);
print "Success, wrote ($somecontent) to file ($filename)";
fclose($handle);
?>
The problem is that I'm first using PHP's function tempnam to create the unique file where fwrite is going to write but I'm not able to specify ".html" as the extension when creating the file.
So when I read the file it shows all the html code.