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
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").

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.