Menu

[r733]: / swfupload / trunk / demos / featuresdemo / upload.php  Maximize  Restore  History

Download this file

64 lines (60 with data), 1.7 kB

 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
session_start();
$upload_good = false;
if (!isset($_FILES["Filedata"])) {
$upload_good = "Not recieved, probably exceeded POST_MAX_SIZE";
}
else if (!is_uploaded_file($_FILES["Filedata"]["tmp_name"])) {
$upload_good = "Upload is not a file. PHP didn't like it.";
}
else if ($_FILES["Filedata"]["error"] != 0) {
$upload_good = "Upload error no. " + $_FILES["Filedata"]["error"];
} else {
$upload_good = "The upload was good";
}
?>
<p>Upload Page</p>
<p>Here is the list of cookies that the agent sent:</p>
<ul>
<?php
foreach ($_COOKIE as $name => $value) {
echo "<li>";
echo htmlspecialchars($name) . "=" . htmlspecialchars($value);
echo "</li>\n";
}
?>
</ul>
<p>Here is the list of query values:</p>
<ul>
<?php
foreach ($_GET as $name => $value) {
echo "<li>";
echo htmlspecialchars($name) . "=" . htmlspecialchars($value);
echo "</li>\n";
}
?>
</ul>
<p>Here is the list of post values:</p>
<ul>
<?php
foreach ($_POST as $name => $value) {
echo "<li>";
echo htmlspecialchars($name) . "=" . htmlspecialchars($value);
echo "</li>\n";
}
?>
</ul>
<p>Here is the list of the files uploaded:</p>
<ul>
<?php
foreach ($_FILES as $name => $value) {
echo "<li>";
echo htmlspecialchars($name) . "=" . htmlspecialchars($value["name"]);
echo "</li>\n";
}
?>
</ul>
<p>Filedata upload status: <?php echo $upload_good; ?>.</p>
<p>Here is the current session id:</p>
<p><?php echo htmlspecialchars(session_id()); ?></p>
<p>Compare this to the session id displayed near the top of the Features Demo page. The Flash Player plug-in does not send the correct cookies in some browsers.</p>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.