-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsend-file.php
34 lines (21 loc) · 856 Bytes
/
send-file.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
//require the validations file and use .
require_once('./VALIDATION/validation-func.php');
$name = $_POST['name'];
$email = $_POST['email'];
$url = $_POST['website'];
$tellnumber = $_POST['tellnumber'];
$messegecontent = $_POST['messegecontent'];
if(Validate_Name($name) == true && ValidateEmail($email) == true && validate_url($url) == true && is_iran_phone($tellnumber) == true){
if(file_exists("contactfile.txt")){
$myfile = fopen("contactfile.txt", "a") or die("Unable to open file!");
}else{
$myfile = fopen("contactfile.txt", "w") or die("Unable to open file!");
}
$txt = "$name \n$email \n$url \n$tellnumber \n$messegecontent \n \n ========================= \n";
fwrite($myfile, $txt);
fclose($myfile);
echo "SUCCESSFUL";
}else{
echo "we have problem !";
}