Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Check {
- public function mty() {
- global $required;
- global $field;
- foreach($required as $field) {
- if (empty($_POST[$field])) {
- //Code...
- } else {
- echo "Good";
- }
- }
- }
- }
- $check = new Check;
- //Gets names of inputs
- $required = array('name', 'price', 'id');
- if(isset($_POST['submit'])) {
- $check->mty();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement