I am PHP noob, but i am trying to learn it. I have handled some variables and obtaining variable from html form and I wanted to take a string that users types in form -here is code of the form on the page
<form method="POST" action="/php/write.php">
<input type="text" name="string"><input type="submit">
</form>
and in subfolder php I have file "write.php" and it looks like this
<?php
chmod(/write.txt, 0755);
$write == $_POST['string'];
$file = fopen("write.txt","w") or die("cant open file");
fwrite($file, $write);
fclose($file);
?>
I have tried to put into normal HTML file but didnt work too. The problem is, when I type in the form and press submit, it redirects me on write.php but nothing happens, "cant open file" isnt written nor some error and the file stays empty and no fwrite works for me. Could someone help me please?