-
Notifications
You must be signed in to change notification settings - Fork 3
/
loadstore.php
52 lines (50 loc) · 1.29 KB
/
loadstore.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
42
43
44
45
46
47
48
49
50
51
52
<?php
if(isset($_FILES['attachment']) && !empty($_FILES['attachment']['name']))
{
if (is_uploaded_file($_FILES['attachment']['tmp_name']))
{
$filePointer = fopen($_FILES['attachment']['tmp_name'], "r");
if ($filePointer!=false)
{
while (!feof($filePointer))
{
$fileLine = fgets($filePointer);
$pos = strpos($fileLine, '=');
if($pos == true)
{
$cookieName=substr($fileLine, 0, $pos);
$cookieVal=substr($fileLine, $pos + 1);
setcookie($cookieName, urldecode($cookieVal), time()+5000*24*60*60, '/');
}
}
fclose($filePointer);
}
}
header('Location: .');
//echo $_COOKIES;
return 0;
}
if(isset($_GET["setParam"]))
{
echo "<html><body>";
echo "<form enctype=\"multipart/form-data\" action=\"loadstore.php\" method=\"POST\"> Emplacement du fichier de parametres: ";
echo "<input name=\"attachment\" type=\"file\" />";
echo "<br/>";
echo "<input type=\"submit\" value=\"Upload\" />";
echo "</form>";
echo "</body></html>";
return 0;
}
else
{
header("Content-type: text/plain");
header("Content-disposition: attachment; filename=olcc_conf.txt");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
while(list($nom, $valeur) = each($_COOKIE))
{
echo $nom . "=" . urlencode($valeur) . "\n";
}
}
?>