/    Sign up×
Community /Pin to ProfileBookmark

Script posts dynamically created fields’s value. The names to these fields are given on the fly. After posting i have to save the values of posted fields in a database. But i dont know the names of the fields posted. so i cannot use $_POST[‘name’].
is there anyway to get them? Thanks

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SheldonApr 08.2008 — If i am understanding you correctly,

Are the field names dynamic every time? What do you want to do with the Data ?
Copy linkTweet thisAlerts:
@migmigauthorApr 08.2008 — i edit cells of a big table. the edited cells' values are being inserted into dynamically created input field.if edited cell's id is 'cell12', then the field created gets name 'mcell12' and id 'mcell12', if i edit 'cell233' field gets name 'mcell233'.after that it is posted. i need to get data via POST.

does it matter what am i gonna do with d posted value? i use GET, but it is not secure. i guess i will have to use ajax.any help appreciated.
Copy linkTweet thisAlerts:
@TheBearMayApr 08.2008 — Maybe this will give you some ideas:

[code=php]
<table>
<?php
foreach ( $_POST as $ind=>$val ) {
echo "<tr><td> $ind </td><td class='val'> $val </td></tr>";
}
?>
</table>[/code]
Copy linkTweet thisAlerts:
@migmigauthorApr 08.2008 — Maybe this will give you some ideas:

[code=php]
<table>
<?php
foreach ( $_POST as $ind=>$val ) {
echo "<tr><td> $ind </td><td class='val'> $val </td></tr>";
}
?>
</table>[/code]
[/QUOTE]


OK i will check it out, thank you.
×

Success!

Help @migmig spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...