All pastes #906423 Raw Edit

Someone

public php v1 · immutable
·published 2008-02-16 18:09 UTC
rendered paste body
<?php$labels = array ('first_name' => 'First Name: ','middle_name' => 'Middle Name: ','second_name' => 'Second Name: ','tel' => 'Tel: ');if(isset($_POST)){foreach($_POST as $field => $values){        if($field != 'middle_name')        {                if($value == '')                {                        $blank_array[] = $field;                }        }}if(sizeof($black_array) > 0){        echo '<b>You didn\'t fill in one or more required fields. You must enter:<br>';        foreach($black_array as $value)        {        echo $value.'<br>';        }        echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';        foreach($labels as $field => $value)        {        $good_data[$field] = strip_tags(trim($_POST[$field]));                echo '<input type="text" name="'.$field.'" size="15" maxlength="15" value="'.$good_data[$field].'">';        }        echo '<input type="submit" value="Sumit">';        echo '</form>';        exit();}} else {        echo 'All required fields contain information';        echo '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';        foreach($labels as $field => $value)        {        echo '<input type="text" name="'.$field.'" size="15" maxlength="15" >';        }        echo '<input type="submit" value="Sumit">';        echo '</form>';}?>