Esempio n. 1
0
                echo $shl;
            }
        } else {
            header("Content-Type: text/plain");
            $raw = $ml->showRawPaste($_GET['id']);
            if ($raw == NULL) {
                echo "Source not found!";
            } else {
                echo $raw;
            }
        }
    } else {
        show_index();
    }
} else {
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        if (isset($_POST['paste']) && !empty($_POST['paste'])) {
            $paste = $ml->addPaste($_POST['paste'], $_SERVER['REMOTE_ADDR']);
            echo $paste;
        } else {
            show_index();
        }
    } else {
        show_index();
    }
}
function show_index()
{
    header("Content-type: text/plain");
    echo file_get_contents("README");
}
Esempio n. 2
0
 *	PHPFilm
 *
 *	Copyright (C) 2002 Daniel Pecos Martínez
 *
 *	Licensed under GPL
 */
include "init.php";
$page = page_order($page, "00");
include "config.php";
if (!isset($lang) || empty($lang) || !file_exists("lang/" . "{$lang}" . ".php")) {
    $lang = "language_en";
}
include "lang/" . "{$lang}" . ".php";
include "common.php";
print_header();
print "  <body bgcolor=\"" . $bgcolor . "\">\n";
print "    <center>\n";
print "      <h1><font color=\"" . $title_color . "\">" . $webtitle . "</font></h1>\n";
print "      <h4><font color=\"" . $title_color . "\">[ <a href=\"index_detailed.php\">{$detailed}</a> | <a href=\"admin\">{$admin}</a> ]\n</font></h4>\n";
$query = "SELECT * FROM " . $db_prefix . "film ORDER BY title;";
show_index($query);
print "      <br><br>\n";
print "      <small><a href=\"http://netpecos.org/projects/phpfilm/\" target=\"_new\"><font color=\"" . $title_color . "\">PHP Film " . $version . "</font></a></small>\n";
/*print "      <p>\n";
print "        <a href=\"http://validator.w3.org/check/referer\"><img border=\"0\"\n";
print "          src=\"http://www.w3.org/Icons/valid-html401\"\n";
print "          alt=\"Valid HTML 4.01!\" height=\"31\" width=\"88\"></a>\n";
print "      </p>\n";*/
print "    </center>\n";
print "  </body>\n";
print "</html>\n";
Esempio n. 3
0
function register()
{
    if (isset($_SESSION['username'])) {
        show_index();
    } else {
        global $connection;
        if (!empty($_POST)) {
            $errors = array();
            $notifications = array();
            if (!empty($_POST["username"])) {
                $username = sanitize_for_db($connection, $_POST['username']);
            } else {
                $errors[] = "Username not entered!";
            }
            if (!empty($_POST["password"])) {
                $passwd = mysqli_real_escape_string($connection, $_POST['password']);
            } else {
                $errors[] = "Password not entered!";
            }
            if (!empty($_POST["password_confirm"])) {
                $passwd_conf = mysqli_real_escape_string($connection, $_POST['password_confirm']);
            } else {
                $errors[] = "Password not entered!";
            }
            if (!empty($_POST["forename"])) {
                $forename = sanitize_for_db($connection, $_POST['forename']);
            } else {
                $errors[] = "Forename not entered!";
            }
            if (!empty($_POST["surename"])) {
                $surename = sanitize_for_db($connection, $_POST['surename']);
            } else {
                $errors[] = "Surename not entered!";
            }
            if (!empty($_POST["usrtel"])) {
                $usrtel = sanitize_for_db($connection, $_POST['usrtel']);
            } else {
                $errors[] = "Phone number not entered!";
            }
            if (!empty($_POST["email"])) {
                $email = sanitize_for_db($connection, $_POST['email']);
            } else {
                $errors[] = "E-mail address not entered!";
            }
            if (!empty($_POST["password_confirm"]) && !empty($_POST["password"])) {
                if ($passwd != $passwd_conf) {
                    $errors[] = "Entered passwords do not match";
                } else {
                    if ($passwd == $passwd_conf && empty($errors)) {
                        // Kontroll, kas  kasutajanimi juba andmebaasis olemas
                        $query = "SELECT username FROM 10153316_user WHERE username = '******'";
                        $result = mysqli_query($connection, $query);
                        if (mysqli_num_rows($result) >= 1) {
                            $errors[] = "Username already in use";
                        } else {
                            // lisab kasutja andmebaasi
                            $query = "INSERT INTO `10153316_user`(`username`, `password`, `phone`, `email`, `forename`, `surename`) VALUES ('" . $username . "', SHA1('" . $passwd . "'), '" . $usrtel . "', '" . $email . "', '" . $forename . "', '" . $surename . "')";
                            $result = mysqli_query($connection, $query);
                            $notifications[] = "Register successful";
                        }
                    } else {
                        $errors[] = "Error!";
                    }
                }
            }
        }
        include 'view/head.html';
        include 'view/register.php';
        include 'view/footer.php';
    }
}