PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Sun Oct 06, 2002 3:10 am
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
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun Oct 06, 2002 4:37 am
Array
(
··[word] => Array
····(
······[0] => field #1
······[1] => field #2
····)
)
seems so
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Sun Oct 06, 2002 5:11 am
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
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Sun Oct 06, 2002 10:39 am
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
rev
Forum Commoner
Posts: 52 Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA
Post
by rev » Sun Oct 06, 2002 1:42 pm
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).
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Sun Oct 06, 2002 2:17 pm
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
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Mon Oct 07, 2002 1:11 am
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
rev
Forum Commoner
Posts: 52 Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA
Post
by rev » Mon Oct 07, 2002 10:48 am
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
Takuma
Forum Regular
Posts: 931 Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:
Post
by Takuma » Mon Oct 07, 2002 11:35 am
Have to learn what I said
rev
Forum Commoner
Posts: 52 Joined: Wed Oct 02, 2002 3:58 pm
Location: Atlanta, GA
Post
by rev » Mon Oct 07, 2002 12:56 pm
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!