Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- $output = '';
- if(isset($_POST['submit']))
- {
- $error = array('fName' => false);
- $_POST['fName'] = isset($_POST['fName']) ? trim($_POST['fName']) : ""; // data initialization and sanitization
- // ...
- // ...
- if($_POST['fName'] == '') // error checking
- $error['fName'] = true;
- // ...
- // ...
- // behavior
- if($error['fName'])
- $output = array('code' => 1, 'msg' => 'There was an error with your input. Please go back and enter all the details.');
- else
- $output = array('code' => 2, 'msg' => 'Email Sent');
- }
- echo json_encode($output);
- $printscreen = ob_get_clean();
- file_put_contents("printscreen.txt", $printscreen);
- echo $printscreen;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement