Page 1 of 1
Help...
Posted: Sun Oct 06, 2002 3:10 am
by Takuma
OK here's a very simple problem which I don't know how to solve, I think I've read this before but couldn't find that post so here it is.
I have the HTML code like:-
Code: Select all
<form method="POST" action="test.php">
<input type="text" name="wordї0]">
<input type="text" name="wordї1]">
<input type="submit" value="go">
</form>
In test.php do I access the "word" like
Code: Select all
<?php
echo $_POSTї'word']ї0];
echo $_POSTї'word']ї1];
?>
?????
Thanks
Posted: Sun Oct 06, 2002 4:37 am
by volka
Array
(
··[word] => Array
····(
······[0] => field #1
······[1] => field #2
····)
)
seems so

Posted: Sun Oct 06, 2002 5:11 am
by twigletmac
Have you tried to access it like that by doing some test code? I think you could answer your own question pretty quickly that way.
Mac
Posted: Sun Oct 06, 2002 10:39 am
by Takuma
ok, thanks anyway...
P.S. I didn't had time to do it myself when I posted it myself, so I thought it would be quicker to do it this way

Re: Help...
Posted: Sun Oct 06, 2002 1:42 pm
by rev
Takuma wrote:
Code: Select all
<?php
echo $_POSTї'word']ї0];
echo $_POSTї'word']ї1];
?>
Will work fine in PHP 4.1.0+. In previous versions substitute $_POST with $HTTP_POST_VARS (note: $HTTP_POST_VARS must be referenced as a global within functions and classes, unfortunately -- where $_POST is already referenced for you).
Posted: Sun Oct 06, 2002 2:17 pm
by twigletmac
Takuma wrote:P.S. I didn't had time to do it myself when I posted it myself, so I thought it would be quicker to do it this way

Yes but you must admit it is fairly lazy. Next time you have something this easy to test please do it yourself. This is not to say that this is a stupid question, it's just that it would have taken you as long to test it yourself as posting the question here and waiting for an answer took and you definitely have the skills to do your own testing.
Mac
Posted: Mon Oct 07, 2002 1:11 am
by Takuma
Sorry... But I do that most of the time, can't help being lazy, I know I got to stop it but... heard. I'll try from next time

Posted: Mon Oct 07, 2002 10:48 am
by rev
I just can't pass on the opportunity...
Takuma, in your own words from
viewtopic.php?t=3400
Takuma wrote:I think he can work that out by himself(or herself)...
heh
Posted: Mon Oct 07, 2002 11:35 am
by Takuma
Have to learn what I said
Posted: Mon Oct 07, 2002 12:56 pm
by rev
We are our own best teachers, no doubt...

If I made no mistakes I would know very little...
wait, I do know very little. Help!