Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP not writing to file even though there are no errors
    text
    copied!<p>I have the following script that is supposed to take the input from two forms and then rewrite two different files with the input from the forms. When I put in text into the forms and run it I get no errors but neither of the files were changed at all. I have all the proper permissions set and correct file paths. I changed the paths in the code below so as not to show sensitive information to my server. I'm really scratching my head at this one since php is a fairly new language to me so any help is greatly appreciated.</p> <p>HTML Code</p> <pre><code>&lt;form name="editfront" action="save.php" method="post"&gt; &lt;div class="editareasmall"&gt; &lt;textarea rows="1" cols="150" id="title" name="title"&gt;&lt;/textarea&gt; &lt;script&gt;$('#title').load('../content/front/Title');&lt;/script&gt; &lt;/div&gt; &lt;div class="contentheader"&gt;Content&lt;/div&gt; &lt;div class="editareabig"&gt; &lt;textarea rows="30" cols="150" id="content" name="content"&gt;&lt;/textarea&gt; &lt;script&gt;$('#content').load('../content/front/Content');&lt;/script&gt; &lt;/div&gt; &lt;input type="submit" value=" Save " class="save"&gt; &lt;/form&gt; </code></pre> <p>PHP Code</p> <pre><code>&lt;?php error_reporting(E_ALL); ini_set('display_errors', true); $title = $_POST['title']; $content = $_POST['content']; $filenametitle = "../content/front/Title"; $filenamecontent = "../content/front/Content"; echo 'Form data has been saved'; $filetitle = fopen($filenametitle, "w") or die("can't open file"); $filecontent = fopen($filenamecontent, "w") or die("can't open file"); fwrite($filetitle,$title); fwrite($filecontent,$content); fclose($filetitle); fclose($filecontent); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload