| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/gavin/workspace/comecondo/backup/ |
Upload File : |
<?php
class Customer
{
public static function saveToFile()
{
$first_name = $_POST["firstname"];
$last_name = $_POST["lastname"];
$full_name = str_replace(' ', '_', $first_name . '_' .$last_name);
$street_address = $_POST["street_address"];
$city = $_POST["city"];
$province = $_POST["province"];
$postal_code = $_POST["postal_code"];
$country = $_POST["country"];
$phone_number = $_POST["phone_number"];
$email = $_POST["email"];
$birthday = $_POST["birthday"];
$driver_license_number = $_POST["driver_license_number"];
$driver_license_expire_date = $_POST["driver_license_expire_date"];
$occupation = $_POST["occupation"];
$employer = $_POST["employer"];
$budget = $_POST["budget"];
$house_type = $_POST["house_type"];
$location_type = $_POST["location_type"];
$unit_type = $_POST["unit_type"];
$parking_lot = $_POST["parking_lot"];
$locker = $_POST["locker"];
$total_files = count($_FILES['idfiles']['name']);
for($i=0; $i<$total_files; $i++){
$filename = str_replace(' ', '', $_FILES['idfiles']['name'][$i]);
move_uploaded_file($_FILES['idfiles']['tmp_name'][$i], './upload/'.$full_name.'_'.$filename);
}
$myfile = fopen('./inputs/'.$full_name . ".txt", "w");
fwrite($myfile, 'Fistname: '.$first_name.PHP_EOL);
fwrite($myfile, 'Lastame: '.$last_name.PHP_EOL);
fwrite($myfile, 'Street Address: '.$street_address.PHP_EOL);
fwrite($myfile, 'City: '.$city.PHP_EOL);
fwrite($myfile, 'Province: '.$province.PHP_EOL);
fwrite($myfile, 'Country: '.$country.PHP_EOL);
fwrite($myfile, 'Phone Number: '.$phone_number.PHP_EOL);
fwrite($myfile, 'Email: '.$email.PHP_EOL);
fwrite($myfile, 'Date of Birth: '.$birthday.PHP_EOL);
fwrite($myfile, 'Driver License Number: '.$driver_license_number.PHP_EOL);
fwrite($myfile, 'Driver License Expire Date: '.$driver_license_expire_date.PHP_EOL);
fwrite($myfile, 'Occupation: '.$occupation.PHP_EOL);
fwrite($myfile, 'Employer: '.$employer.PHP_EOL);
fwrite($myfile, 'Budget: '.$budget.PHP_EOL);
fwrite($myfile, 'House Type: '.$house_type.PHP_EOL);
fwrite($myfile, 'Location Type: '.$location_type.PHP_EOL);
fwrite($myfile, 'Unit Type: '.$unit_type.PHP_EOL);
fwrite($myfile, 'Parking Lot: '.$parking_lot.PHP_EOL);
fwrite($myfile, 'Locker: '.$locker.PHP_EOL);
fclose($myfile);
/*
file_put_contents('./inputs/'.$full_name . ".txt", 'Fistname: '.$fist_name);
file_put_contents('./inputs/'.$full_name . ".txt", 'Lastname: '.$last_name);
file_put_contents('./inputs/'.$full_name . ".txt", 'Street Address: '.$street_address);
*/
}
}
?>