Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*calls saveForm function using 9 inputs from form*/
- saveForm(
- $_POST['inform-username'],
- $_POST['inform-password'],
- $_POST['inform-room_size'],
- $_POST['ensuite'],
- $_POST['price1'],
- $_POST['price2'],
- $_POST['price3'],
- $_POST['price4'],
- $_POST['view'],
- $_POST['comments']);
- header("Location: ../index.php");
- function saveForm($username, $password, $roomcount, $ensuite, $p1, $p2, $p3, $p4, $view, $comments){
- $username = $_POST['inform-username'];
- $password = $_POST['inform-password'];
- $string = "$username||$password";
- if(!strstr($file, "$string"))
- {
- $myFile = "login.txt";
- $fh = fopen($myFile, 'a') or die("can't open file");
- $stringData = "$username\n";
- $stringData = "$password\n";
- fwrite($fh, $stringData);
- fwrite($fh, $stringData);
- fclose($fh);
- }
- else
- {
- echo "";
- }
- }
- }
- $file2 = fopen(__DIR__ . "/" . $username . ".txt", "x+") or die("Unable to open file"); /*opens file*/
- $roomcount = $_POST['inform-room_size'];
- $ensuite = $_POST['ensuite'];
- $p1 = $_POST['price1'];
- $p2 = $_POST['price2'];
- $p3 = $_POST['price3'];
- $p4 = $_POST['price4'];
- $view = $_POST['view'];
- $comments = $_POST['comments'];
- file_put_contents($file2, $username);
- file_put_contents($file2, $password);
- file_put_contents($file2, $roomcount);
- file_put_contents($file2, $ensuite);
- file_put_contents($file2, $p1);
- file_put_contents($file2, $p2);
- file_put_contents($file2, $p3);
- file_put_contents($file2, $p4);
- file_put_contents($file2, $view);
- file_put_contents($file2, $comments);
- fclose($file2);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement