Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TextBox Array problem!! Pls Help

Status
Not open for further replies.

Forri

Programmer
Joined
Oct 29, 2003
Messages
479
Location
MT
Hi

I have a multiple text box in an html page having a name value: P1[0], P1[1] etc!

I read the value as $P1 = S_POST['P1']; !!

The array works but it only reads $P1[0] the others gather no value!!

What can it be and how can i solve it?

Thanks
 
I don't know. The methodology works.

Given the following HTML:

Code:
<html><body><form method=&quot;post&quot; action=&quot;test_showpost.php&quot;>
<textarea name=&quot;p[0]&quot;></textarea>
<textarea name=&quot;p[1]&quot;></textarea>
<textarea name=&quot;p[2]&quot;></textarea>
<textarea name=&quot;p[3]&quot;></textarea>
<input type=&quot;submit&quot;></form>
</body></html>

When the textareas are filled in and the form submitted, then $_POST contains the following in test_showpost.php:

Code:
Array
(
    [p] => Array
        (
            [0] => foo
            [1] => bar
            [2] => bax
            [3] => baz
        )

)

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top