Jump to content

[SOLVED] Form Help


Sleeper

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/99641-solved-form-help/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/99641-solved-form-help/#findComment-509734
Share on other sites

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.