$fp=fopen('C:\xampp\htdocs\'.$_POST['nume_pagina'].'.html','a+');
fwrite($fp,"$sursa\r\n");
fclose($fp);
there are at least 2 different ways to correct this
$fp=fopen('C:\\xampp\\htdocs\\'.$_POST['nume_pagina'].'.html','a+');
fwrite($fp,"$sursa\r\n");
fclose($fp);
$fp=fopen('C:/xampp/htdocs/'.$_POST['nume_pagina'].'.html','a+');
fwrite($fp,"$sursa\r\n");
fclose($fp);
the backslashes need to be escaped by another backslash.
But you can use forwardslashes instead.
a line that will convert backslashes to forward in a string is
$string = 'C:\\xampp\\htdocs\\';
$forward_string = str_replace( '\\', '/', $string );
notice that the replace uses '\' to replace one '\' with one '/'
🙂