source: frontend.php

Last change on this file was 5, checked in by maron, 16 years ago
File size: 1.3 KB
Line 
1<?php
2
3 function show_article($type) {
4 global $database;
5 $Query = $database->select('article', '*', 'type = '.$type);
6 while($DbRow = $Query->fetch_array())
7 {
8 echo '<div id="article"><b>'.$DbRow['name'].'</b><br> '.$DbRow['text'].'</div>';
9 }
10 }
11
12 function show_mass() {
13 global $database;
14 $Query = $database->select('mass', '*', 'time > now()');
15 while($DbRow = $Query->fetch_array())
16 {
17 echo '<div id="article"><b>'.$DbRow['time'].'</b> '.$DbRow['text'].'</div>';
18 }
19 }
20
21 function show_login() {
22 echo '<form action="?admin" method="post">'.GIF_PASS.'<input name="pass" type="password"></form>';
23 }
24
25 function show_upload_mass() {
26 echo UPLOAD_MASS.'<form action="?admin" method="post">
27 '.GIF_DATE.' <input name="date"><br>
28 '.GIF_FILE.' <input name="file" type="file"><br>
29 <input value="Uložit" type="submit">
30 </form>';
31 }
32
33 function save_file() {
34 if (array_key_exists('date',$_POST) ) {
35 if (is_uploaded_file($_FILES['file']['tmp_name'])) {
36 echo "Soubor ". $_FILES['file']['name'] ." Byl nahrán";
37 $tmp_name = $_FILES["file"]["tmp_name"];
38 move_uploaded_file($tmp_name, "mass/".$_POSS['date']);
39 } else {
40 echo "Possible file upload attack: ";
41 echo "filename '". $_FILES['file']['tmp_name'] . "'.";
42 }
43 }
44
45 }
46?>
Note: See TracBrowser for help on using the repository browser.