Hi,
I have a question
i have an textarea for user to key in and a button for user to save what they key in into the textarea.
if i key in '"[/COLOR] in to textarea
and i press the button save the file, the file is not shown '"[/COLOR], it shows \'\"\,
Why the file was added in this symbol [/COLOR] inside my file? This will not happen if i didn't key in these three symbols
Below is my php code and html code.
phpcode
<?PHP
// Check for user data.
if ( $_POST['FileContent'] ) {
// Create a unique-ish filename.
$FileName = "sitemaps.php";
// Create and open the file.
$FileHandle = fopen ( $FileName, 'w' );
// Write the data.
fwrite ( $FileHandle, $_POST['FileContent'] );
// Close the file.
fclose ( $FileHandle );
// Set file header information.
header ( 'Content-Type: text/html' );
header ( 'Content-Description: File Transfer' );
header("Content-Disposition: attachment; filename=\"".basename($filename)."\";");
header ( 'Content-Disposition: attachment; filename="' . basename($FileName) . '"' );
header ( 'Content-Length: ' . filesize($FileName) );
// Push file to client.
readfile($FileName);
// Delete file.
unlink($FileName);
exit();
}
?>
html code
<form action="" method="post">
<textarea name="FileContent"></textarea>
<input type="submit">
</form>
.
I would appreciate if any one can solve this from me.