Jump to content

Recommended Posts

Hello,

 

I wrote a small exportscript for data. One of the values I have to export is called valuta. The export will result in an export of only the value: array.

It is a dropdown menu with predevined values. In the export I need the value.

 

My script:

 

$DataFile = "data.txt";
 
$valuta = $_POST['form']['Valuta'];
 
$fp = fopen($DataFile, 'w') or die('Could not open file!');  
fwrite($fp, "$valuta") or die('Could not write to file');  
fclose($fp);
 
Probable an easy one for someone not being a newbee with PHP?
 
Thanx in advance
Link to comment
https://forums.phpfreaks.com/topic/279353-dropdown-result-in-textfile/
Share on other sites

Form:

 

 

</tr>
<tr class="rsform-block rsform-block-valuta">
<td>Valuta (*)</td>
<td><select  name="form[Valuta][]"  id="Valuta"  class="rsform-select-box" ><option  value="Eur">Eur</option><option  value="USD">USD</option><option  value="GBP">GBP</option><option  value="CZK">CZK</option><option  value="DKK">DKK</option><option  value="SEK">SEK</option><option  value="NOK">NOK</option><option  value="CHF">CHF</option></select><div class="formClr"></div><span id="component2153" class="formNoError">Invalid Input</span></td>
<td></td>
</tr>
 
And Script:
 
$DataFile = "data.txt";
 
$valuta = $_POST['form']['Valuta'];
 
$fp = fopen($DataFile, 'w') or die('Could not open file!');  
fwrite($fp, "$valuta") or die('Could not write to file');  
fclose($fp);
 
Other values are displayed correctly but I won't succeed in displaying the choosen option value.
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.