Sleeper Posted April 5, 2008 Share Posted April 5, 2008 First may I say im still learning so sorry if this is a simple thing. I have a from that im writing to a data folder but I have an issue with the wrighting of the [] values. Say: $don[month]=$_POST["don[month]"]; This will not wright anything but if I change the file name to donmonth and do $don[month]=$_POST["donmonth"]; Then it works fine. But I dont want to do that...lol. I figure there has to be somthing with the []'s that I dont know abuot. Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/ Share on other sites More sharing options...
kenrbnsn Posted April 5, 2008 Share Posted April 5, 2008 Please post the code for the form. Ken Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509733 Share on other sites More sharing options...
Sleeper Posted April 5, 2008 Author Share Posted April 5, 2008 Not sure what your looking for but as I said if I change name to dongoal and take the [] out of the post area it works fine. So I just need to know whats causing the issue or if the $_POST[""] just cnat have [] inside there. And its a long form so ill post the first fields <form id="conf" method="POST" action="inc/don-ty.php"> <tr><td width="33%" align="right" class="f">Goal:</td><td width="65%"> <input type="text" name="don[goal]" size="20" value="<?php echo $don[goal] ?>"></td></tr> <input type="submit" value="Save Settings" name="B1"> </form> Then in the don-ty.php I have <?php $don[goal]=$_POST['don[goa]']; $file_name = "data/donation.php"; $fp = fopen($file_name, "w"); //write to the file fwrite ($fp, "<?php\n"); fwrite ($fp, "\$don[goal]='$don[goal]';\n"); fwrite ($fp, "\n?>"); fclose($fp); ?> and ive tried $_POST['don[goa]']; and $_POST["don[goa]"]; no change. Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509734 Share on other sites More sharing options...
Sleeper Posted April 5, 2008 Author Share Posted April 5, 2008 Sorry had a typos in there. I do have [goal] not [goa] in the coding. Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509735 Share on other sites More sharing options...
kenrbnsn Posted April 5, 2008 Share Posted April 5, 2008 What you want is <?php $don['goal']=$_POST['don']['goal']; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509738 Share on other sites More sharing options...
Sleeper Posted April 5, 2008 Author Share Posted April 5, 2008 resolved - ty Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509747 Share on other sites More sharing options...
kenrbnsn Posted April 5, 2008 Share Posted April 5, 2008 Please mark the topic "solved". Ken Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509749 Share on other sites More sharing options...
Sleeper Posted April 5, 2008 Author Share Posted April 5, 2008 If I knew how to do that I would boss. Feel free to let me know how to do so and ill take care of that for yah. Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509800 Share on other sites More sharing options...
benjaminbeazy Posted April 5, 2008 Share Posted April 5, 2008 it's a little link on the top or bottom of the thread that says topic solved. just search for it on the page (ctrl+f) until u find it. Quote Link to comment https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509803 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.