i've prob with array.i want the value of each txtbox will store in an array. but the coding i've done doesn't work. hope can guide me. Below is part of my coding.
...
">
<?php
if (isset($_POST['cmdSubmit'])){
for ($intBilU=1 ;$intBilU<=3;$intBilU++)
{
$dbUName[$intBilU] =Trim($_POST['txtUName[$intBilU]']);
$dbUProg[$intBilU] =Trim($_POST['txtUProg[$intBilU]']);
$dbUGradYr[$intBilU] =Trim($_POST['txtGradYr[$intBilU]']);
}}
?>
<?PHP for ($intBilU=1 ;$intBilU<=3;$intBilU++){
echo "<TR>University # $intBilU
" .
"
" .
"Program/Achievement |
" .
" |
" .
"Graduation Year |
" .
" |
";
}?>
Comments
: ...
: ">
: <?php
: if (isset($_POST['cmdSubmit'])){
: for ($intBilU=1 ;$intBilU<=3;$intBilU++)
: {
: $dbUName[$intBilU] =Trim($_POST['txtUName[$intBilU]']);
: $dbUProg[$intBilU] =Trim($_POST['txtUProg[$intBilU]']);
: $dbUGradYr[$intBilU] =Trim($_POST['txtGradYr[$intBilU]']);
: }}
: ?>
:
: <?PHP for ($intBilU=1 ;$intBilU<=3;$intBilU++){
: echo "<TR>University # $intBilU
" .
: "
" .
: "
: "
: "
: "
: }?>
:
:
:
Not quite sure, but this is what it should be
[code]
">
<?php
if (isset($_POST['cmdSubmit'])){
for ($intBilU=1 ;$intBilU<=3;$intBilU++)
{
// php will translate the post vars into php-style arrays automatically
$dbUName[$intBilU] =Trim($_POST['txtUName'][$intBilU]);
$dbUProg[$intBilU] =Trim($_POST['txtUProg'][$intBilU]);
$dbUGradYr[$intBilU] =Trim($_POST['txtGradYr'][$intBilU]);
}}
?>
<?PHP for ($intBilU=1 ;$intBilU<=3;$intBilU++){
// sometimes php has troubles identifying where the variable ends when using characters used in php syntax for variables ([] for arrays) so its better to escape from strings
echo "<TR>University # $intBilU
" .
"
" .
"
"
"
"
}?>
[hr][red][italic][b]N[/b][/red][blue]et[/blue][red][b]G[/b][/red][blue]ert[/italic][/blue][hr]