-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpractice.php
executable file
·41 lines (34 loc) · 1 KB
/
practice.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
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Title here</title>
</head>
<body>
<?php
$target_dir = "Uploads/";
$target_file = $target_dir . basename($_FILES["fileName"]["name"]);
move_uploaded_file($_FILES["fileName"]["tmp_name"], $target_file);
echo "Phone number: ";
echo $_POST["username"];
echo "<br>";
$command = escapeshellcmd('python send_sms.py');
$output = shell_exec($command);
echo $output;
$txt = "data.txt";
$fh = fopen($txt, 'w+');
if (isset($_POST['username'])) { // check if both fields are set
$txt=$_POST['username'];
file_put_contents('data.txt',$txt."\n",FILE_APPEND); // log to data.txt
exit();
}
fwrite($fh,$txt); // Write information to the file
fclose($fh); // Close the file
#shell_exec("python /Applications/XAMPP/htdocs/send_sms.py");
$command = escapeshellcmd("/usr/bin/python send_sms.py");
$output = shell_exec($command);
echo $output;
echo "php_works";
?>
</body>
</html>