geldd001 Posted June 19, 2013 Share Posted June 19, 2013 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 Quote Link to comment Share on other sites More sharing options...
litebearer Posted June 19, 2013 Share Posted June 19, 2013 1. what error are you receiving? 2. have you tried echoing $valuta? Quote Link to comment Share on other sites More sharing options...
geldd001 Posted June 19, 2013 Author Share Posted June 19, 2013 1. I don't receive an error 2 The result when i am using Echo is "Array" Quote Link to comment Share on other sites More sharing options...
litebearer Posted June 19, 2013 Share Posted June 19, 2013 Show us your form and your full script Quote Link to comment Share on other sites More sharing options...
geldd001 Posted June 19, 2013 Author Share Posted June 19, 2013 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. Quote Link to comment Share on other sites More sharing options...
Barand Posted June 19, 2013 Share Posted June 19, 2013 Why such a complex name for the select? Instead of <select name='valuta' ... > Then access it with $_POST['valuta'] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.