Jump to content

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

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.