Yani şu var:
<?php
show_form();
?>
<form id="add" method="post" action="addIssue.php">
Name:
<?php input_text('name','str_name', $defaults , '1'); ?>
<input class="submit" type="submit" value="Begin download" />
<input type="hidden" name="_submitCheck" value="1"/>
</form>
<?php
function show_form($errors = '')
{
// If form is submitted, get the defaults from submitted parameters
if(empty($_POST['_submitCheck']) OR !$_POST['_submitCheck'] ){
// set our own defaults
$defaults = array('str_name' => '');
} else {
$defaults = $_POST;
}
}
// Echo text box
function input_text($elem_id, $element_name, $values, $tab='') {
echo '<input id="'.$elem_id.'" name="'.$element_name.'"';
echo ' tabindex="'.$tab.'" class="text" value="';
echo htmlentities($values[$element_name]) . '" />';
}
?>
Neden şu Bildirimini alıyorum?
Notice: Undefined variable: defaults