Hits: 39639

 

Absolute path found. Loading as relative.

 

List

Try: ca/tecreations/ViewFile.php -- Online


<?php
require_once $_SERVER['DOCUMENT_ROOT'] . "/tec_SiteRoot.php";
global $db;

//$db->setDebug(/*empty, true, or false*/);
//$db->issue("DELETE FROM todays_chat");

if (strcmp($_REQUEST['submit'],"Post") == 0) {
    $poster = "unset";
    if (isset($_REQUEST['tec_poster'])) {
        if (empty($_REQUEST['tec_poster'])) {
            die("Unauthorized(1)");
        } else {
            $poster = $_REQUEST['tec_poster'];
        }
    } else if (isset($_REQUEST['public_poster'])) {
        if (empty($_REQUEST['public_poster'])) {
            $poster = "unset";
        } else {
            $poster = $_REQUEST['public_poster'];
        }
    } else {
        die("Unauthorized(2)");
    }
    if (strcmp($poster,"unset") == 0) {
        print($poster . "<br />\n");
        print_r($poster . "<br />\n");
        die("Dead");
    }

    $txt = "unset";
    if (isset($_REQUEST['ttxt'])) {
        if (empty($_REQUEST['ttxt'])) {
            die("Unauthorized(3)");
        } else {
            $txt = $_REQUEST['ttxt'];
        }
    } else if (isset($_REQUEST['public_post'])) {
        if (empty($_REQUEST['public_post'])) {
            die("Unauthorized(4)");
        } else {
            $txt = $_REQUEST['public_post'];
        }
    }
    if (strcmp($txt,"unset") == 0) {
        print($txt . "<br />\n");
        print_r($txt . "<br />\n");
        die("Dead(687)");
    }
    $sql = "INSERT INTO todays_chat (poster,text) VALUES('$poster','" . htmlentities($txt,ENT_QUOTES|ENT_HTML401) ."')";
    $db->issue($sql);
    header("Location: https://tecreations.ca/");
} else {
    die("Unauthorized(0)");
}