Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-11-2007, 02:50 AM   PM User | #1
meshhat
New to the CF scene

 
Join Date: Nov 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
meshhat is an unknown quantity at this point
$_POST and array

I'm passing 100 variables (named gaintxt0, gaintxt1....gaintxt100) using a POST. I would like to put these variables into an array. However, I'm having trouble with the syntax for the $_POST.

I'm trying to do something like this, but it's not working:

PHP Code:
<?
$myArray 
= array();

for(
$i=0$i<=100$i++){
   
array_push($myArray$_POST[gaintxt[$i]]);
}

?>
Any ideas?
meshhat is offline   Reply With Quote
Old 11-11-2007, 03:04 AM   PM User | #2
PappaJohn
Senior Coder

 
Join Date: Apr 2007
Location: Quakertown PA USA
Posts: 1,028
Thanks: 1
Thanked 125 Times in 123 Posts
PappaJohn will become famous soon enough
PHP Code:
<?
$myArray 
= array();

for(
$i=0$i<=100$i++){
   
array_push($myArray$_POST['gaintxt' $i]);
}

?>
__________________
John
PappaJohn is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:33 AM.


Advertisement
Log in to turn off these ads.