Esempio n. 1
0
 //Checks if form is submited or not.
 $strErrorMessage = "";
 $intError = 0;
 if (trim($_POST["newstitle"]) == "") {
     $strErrorMessage .= "Please enter news title<br />";
     $intError = 1;
 }
 if (trim($_POST["meta_keyword"]) == "") {
     $strErrorMessage .= "Please enter metatag keyword<br />";
     $intError = 1;
 }
 if (trim(strip_tags($_POST["meta_description"])) == "") {
     $strErrorMessage .= "Please enter metatag description<br />";
     $intError = 1;
 }
 if ($hldGlobal->fnCheckDescription(trim($_POST["ncontent"])) == "") {
     $strErrorMessage .= "Please enter news description<br />";
     $intError = 1;
 }
 if (!$intError) {
     foreach ($_POST as $key => $value) {
         $_POST[$key] = mysql_escape_string(trim($value));
     }
     $sqlInsUser = "******" . $_POST["newstitle"] . "','" . $_POST["meta_keyword"] . "','" . $_POST["meta_description"] . "','" . $_POST["ncontent"] . "','1','" . date("Y-m-d H:i:s") . "')";
     mysql_query($sqlInsUser);
     header("Location:message.php?mess=12");
 }
 $hdlTpl->setVariable("error_message", $strErrorMessage);
 //Assigns error message
 $hdlTpl->setVariable("newstitle", $_POST["newstitle"]);
 //Assigns news title
Esempio n. 2
0
$hdlTpl->setVariable("footer", $strFooter);
//Assigns footer
$hdlTpl->setVariable("leftmenu", $strLeftMenu);
//Assigns left menu
if ($_POST["submit"] == "Save") {
    $strErrormessage = "";
    $intError = 1;
    if (trim($_POST["title"]) == "") {
        $strErrormessage .= "Please enter title.<br>";
        $intError = 0;
    }
    if (trim($_POST["sdesc"]) == "") {
        $strErrormessage .= "Please enter shot description.<br>";
        $intError = 0;
    }
    if ($hldGlobal->fnCheckDescription($_POST["ldesc"]) == "") {
        $strErrormessage .= "Please enter long description.<br>";
        $intError = 0;
    }
    if (trim($_POST["title"]) != "") {
        if ($hldGlobal->fnCheckTechnique(trim($_POST["title"]), $_GET["id"])) {
            $strErrormessage .= "Technique already present.<br>";
            $intError = 0;
        }
    }
    if (is_array($_FILES["img"]) && $_FILES["img"]["error"] == 0) {
        list($width, $height, $type, $attr) = getimagesize($_FILES['img']['tmp_name']);
        $arrPathInfo = pathinfo($_FILES["img"]["name"]);
        $strExtension = $arrPathInfo["extension"];
        list($usec, $sec) = explode(" ", microtime());
        $filename = $arrPathInfo["filename"] . $usec . $sec . "." . $arrPathInfo["extension"];