Hi all,
I would like to know how to assign and get the form value when I using it in a loop. I cannot get all the input that I inserted in 'Desc' part and it is from this site. May I know to get this work when I do a loop? Thanks.
a.php
[HTML]// this can work
<font size="2">Title: </font><br><input type="text" name="Title[]" size="40" value="<?php echo htmlentities($m atch[$counter], ENT_QUOTES); ?>">
</tr>
<tr> </tr>
// but this can only get the last input when do multiple post
<tr>
<font size="2">Descri ption:</font>
<script language="JavaS cript" type="text/javascript">
<!--
function submitForm() {
updateRTE('Desc ');
return true;
}
initRTE("images/", "", "");
writeRichText(' Desc', '', 350, 200, true, false);
//-->
</script>
</tr>[/HTML]
b.php
[PHP]$title= $_POST['Title'];
$desc= $_POST['Desc'];
mysql_query("in sert into post(title, description)val ues ('$title[$counter]', '$desc[$counter]')")or die (mysql_error()) ;[/PHP]
I would like to know how to assign and get the form value when I using it in a loop. I cannot get all the input that I inserted in 'Desc' part and it is from this site. May I know to get this work when I do a loop? Thanks.
a.php
[HTML]// this can work
<font size="2">Title: </font><br><input type="text" name="Title[]" size="40" value="<?php echo htmlentities($m atch[$counter], ENT_QUOTES); ?>">
</tr>
<tr> </tr>
// but this can only get the last input when do multiple post
<tr>
<font size="2">Descri ption:</font>
<script language="JavaS cript" type="text/javascript">
<!--
function submitForm() {
updateRTE('Desc ');
return true;
}
initRTE("images/", "", "");
writeRichText(' Desc', '', 350, 200, true, false);
//-->
</script>
</tr>[/HTML]
b.php
[PHP]$title= $_POST['Title'];
$desc= $_POST['Desc'];
mysql_query("in sert into post(title, description)val ues ('$title[$counter]', '$desc[$counter]')")or die (mysql_error()) ;[/PHP]
Comment