]> git.ozlabs.org Git - ccan/blob - web/uploader.php.cpp
tlist: use ccan/tcon
[ccan] / web / uploader.php.cpp
1 <?php
2 session_start();
3 ?>
4 #include "logo.html"
5 #include "menulist.html"
6 #include "static-configuration"
7 <?php
8
9 // We just email notification for now.  Auto-analysis RSN.
10 if ($_FILES["uploadedfile"]["error"] > 0) {
11   echo "Error: " . $_FILES["uploadedfile"]["error"] . "<br />";
12   exit();
13 }
14
15 $dest = tempnam($tempfolder, "upload-");
16 move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], $dest);
17
18 $subject = "CCAN: code upload by '" . $_POST['email'] . "' with name " . $_FILES["uploadedfile"]["name"];
19 $message = "File type: ".$_FILES["uploadedfile"]["type"]."\n".
20         "Size: ".$_FILES["uploadedfile"]["size"]."\n".
21         "Claimed email: ".$_POST['email']."\n".
22         "File destination: ".$dest."\n";
23
24 mail($ccanadmin, $subject, $message, "From: $frommail");
25 echo "<div align=\"center\"> Thanks!<br>
26         Mail will be send to admin to publish the code.<//div>";
27 ?>