Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Changing name of $_post['var']....
Old 04-22-2010, 07:12 AM Changing name of $_post['var']....
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi Forum,

Here's a problem I stuck with that.......I am using post method to get data..........but I want to change the my input names like this....
PHP Code:
for($i=1$i<=$_POST['rows_num']; $i++)
{
$x "plat_val".$i;
                        
//print $x;
                        
$platinum[$i] = $_POST['$x']; 
In the above code I want to get the value of my plat_val1....to...12 into $platinum[$i] so what I am trying to get this name in $x and using it with $_POST.....but it shows nothing.....that means I mistook somewhere.....

Please help me to sort this out.....

Your suggestions would be appreciated.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 04-22-2010 at 07:20 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-22-2010, 08:37 AM Re: Changing name of $_post['var']....
Novice Talker

Posts: 11
Trades: 0
Hi Isabella.

There should be no single quotes in $_POST['$x'] in your case.

Fixed code:
Code:
for($i=1; $i<=$_POST['rows_num']; $i++)
{
$x = "plat_val".$i;
                        //print $x;
                        $platinum[$i] = $_POST[$x];
__________________

Please login or register to view this content. Registration is FREE
.:. Professional Hosting since 2003
2wdh.com is offline
Reply With Quote
View Public Profile Visit 2wdh.com's homepage!
 
Old 04-23-2010, 03:07 AM Re: Changing name of $_post['var']....
casius's Avatar
Super Talker

Posts: 129
Trades: 0
Hello,

Don't used quote just pass the

$_POST[$field];
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
casius is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Changing name of $_post['var']....
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11873 seconds with 12 queries