Jump to content

[SOLVED] fwrite not working:(


eronmezza

Recommended Posts

please help someone, might be lame mistake.

here's the cde:

 

<body>
<form>
<p><span class="style1">Versenyidőpont neve</span><span class="style2">:</span>
  <input type="text" size="12" maxlength="12" name="Nam">
</p>
<p> </p>
<input type="submit" value="Küldés" name="submit">
</form>

  <?
  $outpu = $_POST['Nam'] . "|";
  $Nam = $_POST["Nam"];
   
   
   if (!isset($_POST['submit'])) {
} else {
$filenam="idopontok.txt";
$filetartal = fopen($filenam,"a+");
fwrite($filetartal, $outpu);
}
  ?>

</body>

Link to comment
https://forums.phpfreaks.com/topic/67041-solved-fwrite-not-working/
Share on other sites

Do you get an error or just a blank file? Is your if condition executing the code you want? try putting an echo statement above the fopen and see if something gets echoed. If you think it is the string, try using a constant string to test it like, fwrite($handle, "test").

no error, no echo after the ifelse statement,  no write in the file here:

<body>
<form>
<p><span class="style1">Versenyidőpont neve</span><span class="style2">:</span>
  <input type="text" size="12" maxlength="12" name="Nam">
</p>
<p> </p>
<input type="submit" value="Küldés" name="submit">
</form>

<?
  $outpu = $_POST['Nam'] . "|";
  $Nam = $_POST["Nam"];
   
   
   if (!isset($_POST['submit'])) {
} else {
$filenam="idopontok.txt";
echo "tilláromhajj";
$filetartal = fopen($filenam,"a+");
fwrite($filetartal, "tilláromhajj");
}
?> 

 

can't the problem be the $_POST('submit') part?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.