/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] posting form array values problem

hi all,

I have multiple text boxes and i want to get all the text box values in a single string using post method.it has been done but the problem is that “Array” this word is coming at the very beginning when i am doing concatenation with “#”.

Here is my code:

//if the form is being submitted

[LEFT]if(isset($_POST[“submit1”]))
{
foreach($_
POST[‘name’] as $key => $value)
{
$name .= “#”. $value ;

}

echo $name;
}

//the form part
<form action=”” method=”post” name=”frm”>
<?
for($i=1;$i<=$5;$i++)
{
?>
<tr>
<td width=”24%”>Name
<?=$i;?>
:</td>
<td width=”76%”>
<input maxlength=60 name=”name[]” size=25>
</td>
</tr>
<? } ?>
<input name=”submit1″ type=”submit” value=”Proceed” class=”button”>
</form>[/LEFT]

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@balloonbuffoonMar 30.2006 — [code=php]
<?
//if the form is being submitted

if(isset($_POST["submit1"])) {
unset($name);
foreach($_POST['name'] as $key => $value) {
$name .= "#". $value ;
}
echo $name;
}
?>

//the form part
<form action="" method="post" name="frm">
<?
for($i=1;$i<=5;$i++) {
?>
<tr>
<td width="24%">Name
<?=$i;?>
:</td>
<td width="76%">
<input maxlength=60 name="name[]" size=25>
</td>
</tr>
<? } ?>
<input name="submit1" type="submit" value="Proceed" class="button">
</form>
[/code]


--Steve
Copy linkTweet thisAlerts:
@raj_2006authorMar 31.2006 — Hi,

Its working.............Thanks mate......... ?

With luv,

Raj
×

Success!

Help @raj_2006 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.29,
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,
)...