Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Sending an array from a form

 
   Database Forums (Home) -> PHP RSS
Next:  Replication from 2000 sp3 to 2005  
Author Message
Mike

External


Since: Dec 13, 2005
Posts: 1



(Msg. 1) Posted: Tue Jan 17, 2006 7:55 am
Post subject: Sending an array from a form
Archived from groups: comp>lang>php (more info?)

Hello,
How do I send an array from a form to another php page?I want to bundle
up some data from form fields in an array and send them together like that.
I must be missing something?
Thanks
Mike

 >> Stay informed about: Sending an array from a form 
Back to top
Login to vote
Kimmo Laine

External


Since: Dec 28, 2005
Posts: 17



(Msg. 2) Posted: Tue Jan 17, 2006 7:55 am
Post subject: Re: Sending an array from a form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Mike" wrote in message

> Hello,
> How do I send an array from a form to another php page?I want to bundle
> up some data from form fields in an array and send them together like
> that. I must be missing something?
> Thanks
> Mike


<html><body>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="get">
<input type="text" name="myarray[]" value="you">
<input type="text" name="myarray[]" value="mean">
<input type="text" name="myarray[17]" value="like">
<input type="text" name="myarray[dog]" value="this?">
<input type="submit">
</form>
<?php print_r($_GET['myarray']); ?>
</body></html>

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
spam.TakeThisOut@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)

 >> Stay informed about: Sending an array from a form 
Back to top
Login to vote
ampeloso

External


Since: Nov 08, 2005
Posts: 2



(Msg. 3) Posted: Tue Jan 17, 2006 8:34 am
Post subject: Re: Sending an array from a form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I am the original poster.(Different login-google).
To Kimmo: Now I have 2 ways of doing it. How long would it have been
for me to learn both ways.
So the reply to you're comment "Makes me wonder why people don't read
the documentation Wink" (which we all see at least once in every long
post) is
I (We) do read the documentation. But:
A. Sometimes we cant find what we're looking for fast enough.If we
knew the answer we wouldnt ask.
B. Sometimes we cant find what we're looking for .
C. More often you get better advice from other people.
Thanks,
Mike
 >> Stay informed about: Sending an array from a form 
Back to top
Login to vote
user1661

External


Since: Dec 02, 2004
Posts: 27



(Msg. 4) Posted: Tue Jan 17, 2006 8:55 am
Post subject: Re: Sending an array from a form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Kimmo Laine" wrote in message

> "Mike" wrote in message
>
>> Hello,
>> How do I send an array from a form to another php page?I want to
>> bundle up some data from form fields in an array and send them together
>> like that. I must be missing something?
>> Thanks
>> Mike
>
>
> <html><body>
> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="get">
> <input type="text" name="myarray[]" value="you">
> <input type="text" name="myarray[]" value="mean">
> <input type="text" name="myarray[17]" value="like">
> <input type="text" name="myarray[dog]" value="this?">
> <input type="submit">
> </form>
> <?php print_r($_GET['myarray']); ?>
> </body></html>

serialize is a lot easier Wink

>
> --
> "En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
> spam.TakeThisOut@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
>
 >> Stay informed about: Sending an array from a form 
Back to top
Login to vote
ampeloso

External


Since: Nov 08, 2005
Posts: 2



(Msg. 5) Posted: Tue Jan 17, 2006 9:40 am
Post subject: Re: Sending an array from a form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Bob_M

External


Since: Jan 17, 2006
Posts: 1



(Msg. 6) Posted: Tue Jan 17, 2006 10:02 pm
Post subject: Re: Sending an array from a form [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 17 Jan 2006 11:26:36 GMT, "Mike"
wrote:

>Hello,
> How do I send an array from a form to another php page?I want to bundle
>up some data from form fields in an array and send them together like that.
>I must be missing something?
>Thanks
>Mike
>
Just my $.02 worth:

I'm doing the same thing with multiple multi-dimensional arrays that
must pass from one form to another. Advice received from this site
recommended storing the arrays in $_SESSION['array_name'] and it works
just fine.

There, you now have THREE ways to do the same thing. And I, too, DO
read the manuals, the docs, buy the book, subscribe to the mags, etc.,
and I STILL ask here because here (and other forums) provide REAL
WORLD ANSWERS that seem to work.

After all, we read these forums to learn and, if possible, to share
our knowledge and help someone else.

Bob
 >> Stay informed about: Sending an array from a form 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Sending an email from a form on a personal website using S.. - Can anyone please point me to a recommended tutorial or app that will help me make my own contact page on a personal website. 1. I am wanting the user to be able to send me a mail from the website. (I think the average settings are '/usr/lib/sendmail') 2...

Newbie Question: How to prevent sending blank form Script .. - I have an html form which goes to this script. It works, but I want to prevent the form input being sent unless some of the input fields have data. The reason is so that people don't submit blank forms by accident (which triggers a counter, not shown....

Form Data -> Variables or an Array? - Hi I need help! Forgive me I am a PHP newbie. I have a small script that enables me to send a form from an HTML page. I want to use the HTML formatted form because the design of my website is complex, and I don't want to have to mess around with..

accessing array data inside of an array - I want to extract the name of the photo uploaded. print_r of $_FILES yields: Files: Array ( [picture] => Array ( [name] => DSC_1802-saoirse-riona.jpg [type] => image/jpeg [tmp_name] => /tmp/phpJTspHZ [error] => 0 [size] => 76096 ) ) ...

Sending SMS with PHP - How do you send an SMS with PHP? Right now, I send text messages to verizon users by just adding @vtext.com to their phone number and emailing that. Is there something like this that I could do for other phone companies? Or is there some universal way...
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]