Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $input = $_POST['input'];
- $output = $_POST['output'];
- $replies = file('/this/is/where/my/file.is'); // I think I need to modify permissions on this file...
- $found = false;
- for ($i = 0; $i < count($replies); $i += 2) {
- echo $replies[i];
- echo '</br>';
- echo $replies[i+1];
- if (strcasecmp($input, $replies[i])) {
- $replies[i+1] = $output;
- $found = true;
- break;
- }
- }
- if (!$found) {
- array_push($replies, $input, $output);
- }
- $file = fopen('/this/is/where/my/file.is');
- fwrite($file, join("\n",$lines));
- fclose($file);
- echo $input;
- echo '</br>';
- echo $output;
- echo '</br>';
- echo "Saved!";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement