Hi,
I want to reload a PHP page so that it could execute a function. However, after reloading, the array seems to display, could anyone suggest me a solution, here is my coding:
<?php
// the array
$amt = $_POST['info'];
...
function update() {
foreach ($amt as v1) {
.....
}
};
?>
// html body
<form name="form1" method="post" action="<?php echo $PHP_SELF ?>">
...
<td width="99"><input name="Confirm" type="submit" id="Confirm" >
<input type="hidden" name="action" value="action_name">
<?php echo '<input type="hidden" name="info" value="$amt">'; ?>
// end of the html
The error appears inside the function which shows that the "foreach" loop is invalid after the page is reloading.
Thank you very much.