Pete wrote:

>In message <[EMAIL PROTECTED]>, Carl Seghers
><[EMAIL PROTECTED]> writes
>  
>
>>I am not sure what your question is.  After submittal, the variable 
>>$_POST['title'] will contain the value of that field. 
>>
>>If all forms have the same field named 'title', and you were to put all 
>>these fields in one form, then you'd have to code all fields like this:
>>
>><INPUT TYPE='text' NAME='title[]' VALUE=''>
>>
>>After submittal, the variable[0] would contain the value 
>>of that field in the first form, $_POST['title'][1] would contain the 
>>value in the second form, etc... 
>>
>>If that's not the answer you're after, I don't understand the question, 
>>sorry.
>>    
>>
>
>I think that it is the answer.
>
>It sounds too simple <G>
>
>Not very good at arrays (yet) - 
>can I get the number of forms by something like 
>count($_POST['title']);
>(because all forms will have the same fields, so I can pick any
>field...)
>?
>
>  
>

No, the array count would always be equal to the number of 'forms'.  For 
the ones that are not filled in the $_POST array would just contain 
empty values, which BTW you can easily see for yourself with this little 
thing:

<?php
if (count($_POST)) {  print "<pre>"; print_r($_POST); print "</pre>"; }
?>
<form method="POST">
<input type="text" name="title[]"><br/>
<input type="text" name="title[]"><br/>
<input type="text" name="title[]"><br/>
<input type="submit">

Rgds
Carl



[Non-text portions of this message have been removed]



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to