I am create upload form by fwrite function php. My code is here
<?php
$file = fopen("C:/xampp/htdocs/eibak/sss.php","w");
echo fwrite($file,"<?php
if (isset($_POST['submit'])) {
$file = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
$dir = '';
echo $dir;
if (move_uploaded_file($temp, $dir.$file)) {
$link = $dir.$file;
?>
<?php } } ?>
<form action='' method='POST' enctype='multipart/form-data'>
<input type='file' name='file'/>
<input type='submit' name='submit' value='Submit'/>
</form>");
fclose($file);
?>
But Parse error: syntax error,
unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in C:\xampp\htdocs\exploit\ff.php on line 5 error show.
How to create upload form with file write php.