Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_SERVER['REQUEST_METHOD'] === 'POST')){
- //post data
- $nick = $_POST['nickname'];
- $match = $_POST['match'];
- $description = $_POST['description'];
- $oras = $_POST['oras'];
- if(empty($_POST)){
- //post data empty
- print 'Campurile sunt goale, completeaza te rog.';
- die(); //stop script execution
- } else {
- $file_path = './script/folder/file.txt';
- if(!file_exists($file_path)){
- print 'Fisierul nu exista sau calea spre fisier nu este buna.';
- die();
- } else {
- $handle = fopen($file_path, "a");
- $write = fwrite($handle, "\n".$match." ".$nickname." ".$oras." ".$description."\n");
- fclose($handle);
- if(!$write){
- print 'Eroare de scriere in fisier.';
- } else {
- header('Location: /xx/replaysend.php');
- }
- }
- }
- }
- ?>
- <form action="" method="post">
- <p>Nickname: <input type="text" name="nickname" size="18" /></p>
- <p>Match: <input type="text" name="match" size="18" /></p>
- <p>Description: <input type="text" name="description" size="18" /></p>
- <p>Town: <input type="text" name="oras" size="18" /></p>
- <p><input type="submit" name="submit" value="Send" /></p>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement