I am currently using a server that will not allow using a variable that is undefined. The way I can get around this when using $_GET and $_POST is [php]
if (isset($_POST[‘variable’])) {
$variable = $_POST[‘variable’];
} else {
$variable = “”;
}
[/php]
But the problem is: I have a form and the number of input boxes depends on the number of records in the mysql table. Then what they put in the input boxes gets sent to another page. I need to use the solution above for every input box.
The following is what I have attempted to do ( $num_rows is the number of rows in the mysql, and the input boxes names are menu(id)).
[php]
if ( $num_rows == “” ) {
} else {
while ( $num_rows >= 1 ) {
$menu.$num_rows = $_POST[‘menu’.$num_rows];
$num_rows–;
}
}
[/php]
it is meant to do:
$menu1 = $post [‘menu1’]:
$menu1 = $post [‘menu2’];
$menu1 = $post [‘menu3’];
$menu1 = $post [‘menu4’];
$menu1 = $post [‘menu5’];
… until it runs out of records
Could someone help me currect my code?
Thanks,