Static generation of web pages. Based on GSoC work, and still needs
[ccan] / web / uploader.php
1 <?php
2 session_start();
3 include('logo.html');
4 include('menulist.html');
5 include('static-configuration');
6
7 // We just email notification for now.  Auto-analysis RSN.
8 if ($_FILES["uploadedfile"]["error"] > 0) {
9   echo "Error: " . $_FILES["uploadedfile"]["error"] . "<br />";
10   exit();
11 }
12
13 $dest = tempnam($tempfolder, "upload-");
14 move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], $dest);
15
16 $subject = "CCAN: code upload by '" . $_POST['email'] . "' with name " . $_FILES["uploadedfile"]["name"];
17 $message = "File type: ".$_FILES["uploadedfile"]["type"]."\n".
18         "Size: ".$_FILES["uploadedfile"]["size"]."\n".
19         "Claimed email: ".$_POST['email']."\n".
20         "File destination: ".$dest."\n";
21
22 mail($ccanadmin, $subject, $message, "From: $frommail");
23 echo "<div align=\"center\"> Thanks!<br>Stored to temporary location. 
24         Mail will be send to admin to get verification of the code.<//div>";
25 ?>