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 12-25-2010, 03:40 AM   PM User | #1
rajeshwar
New to the CF scene

 
Join Date: Dec 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rajeshwar is an unknown quantity at this point
Unhappy catching in array the values posted from a form

I have two pages in one page i am posting values in array
///////////////
for($i=0;$i<$tenant;$i++)
echo "<tr><td><input type=\"text\" size=\"17\" maxlength=\"20\" name=\"name.$i\"></td><td><input type=\"text\" size=\"17\" maxlength=\"4\" name=\"cur.$i\"></td><td><input type=\"text\" size=\"17\" maxlength=\"4\" name=\"prev.$i\"></td><td><input type=\"text\" size=\"17\" maxlength=\"1\" name=\"room.$i\"></td></tr>";
\\\\\\\\\\\\\\\\\\
then how to catch those values in array in the second page

i can see the value posted as
/////////////
Array
(
[name_0] => Lakhan
[cur_0] => 511
[prev_0] => 506
[room_0] => 1
[name_1] => Rabi
[cur_1] => 297
[prev_1] => 292
[room_1] => 1
[name_2] => Sunil
[cur_2] => 2428
[prev_2] => 2400
[room_2] => 2
[amount] => 1200
)

/////////////////
by impkying echo command
/////////////////////////


<?php
echo "<PRE>";
print_r($_POST);
echo "</PRE>";
//how to keep the value in array which have been received in this script i tried but not succeded

?>
//////////////


please i need urgent suggestion.
thanks
rajeshwar is offline   Reply With Quote
Old 12-25-2010, 06:18 AM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,741
Thanks: 4
Thanked 2,465 Times in 2,434 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I'm not sure I follow you. All for values are already within an array, if you need a separate one, just copy it:
PHP Code:
$a $_POST
If this isn't what you are looking for you need to be more specific as to what it is you are looking for.
__________________
PHP Code:
header('HTTP/1.1 420 Enhance Your Calm'); 
Fou-Lu 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 03:33 PM.


Advertisement
Log in to turn off these ads.