H69UNtblNBNpha2dtB1Odn8qYp1Qk5NK2gi7yfceofo9N
/
home
/
ymswebso
/
public_html
/
aussieeducation
/
sitecms
/
process-update
/
Nama File / Folder
Size
Action
update-attribute-process.php
0.958KB
Hapus
Edit
Rename
update-page.php
3.575KB
Hapus
Edit
Rename
update-photo-status.php
0.705KB
Hapus
Edit
Rename
update-video.php
0.676KB
Hapus
Edit
Rename
<=Back
<?php ob_start(); ?> <?php include("../includes/session.php"); ?> <?php include("../includes/login-verify.php"); ?> <?php include("../includes/printmsg.php"); ?> <?php include("../includes/extra-vars.php"); ?> <?php include("../includes/connection.php"); ?> <?php ///// code start here ///// // define variables and set to empty values if ($_SERVER["REQUEST_METHOD"] == "POST") { $page_id = form_fields($_POST["page_id"]); $page_type = form_fields($_POST["page_type"]); $header_img_exist = form_fields($_POST["header_img_exist"]); $rootpage_id = form_fields($_POST["rootpage_id"]); $mainpage_id = form_fields($_POST["mainpage_id"]); $page_order = form_fields($_POST["page_order"]); @$show_in = form_fields($_POST["show_in"]); $page_name = form_fields($_POST["page_name"]); $slug_replaced = preg_replace("/[^a-zA-Z ]/", "", $page_name); $page_slug_output = str_replace(' ', '-', $slug_replaced); $page_slug = strtolower($page_slug_output); $page_description = form_fields($_POST["FCKeditor1"]); $meta_keywords = form_fields($_POST["meta_keywords"]); $meta_description = form_fields($_POST["meta_description"]); $status = form_fields($_POST["status"]); $modified = form_fields($today); $created = form_fields($today); } function form_fields($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); $data = mysql_real_escape_string($data); return $data; } ///////// fetching the file extension with $imageFileType //////////// $target_dir = "../../uploaded/image/"; $target_file = $target_dir . basename($_FILES["header_img"]["name"]); $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); ////////////////////////////////////////////////// $rand_number = rand(); $file_name = $_FILES['header_img']['name']; $output_file = str_replace(" ","",$file_name); $new_file_name = $rand_number."_".$output_file; $path = "../../uploaded/image/".$new_file_name; if($imageFileType=="jpg" || $imageFileType=="jpeg" || $imageFileType=="gif" || $imageFileType=="png") { move_uploaded_file($_FILES['header_img']['tmp_name'], $path); $header_img = $new_file_name; $img_exist_path = "../../uploaded/image/".$header_img_exist; !unlink($img_exist_path); } else { $header_img = $header_img_exist; } if($page_type=="root") { $sql = ("update page_root set page_order = '$page_order', show_in = '$show_in', page_name = '$page_name', page_description = '$page_description', meta_keywords = '$meta_keywords', meta_description = '$meta_description', header_img = '$header_img', status = '$status', modified = '$today' where id = '$page_id'"); } elseif($page_type=="main") { $sql = ("update page_main set rootpage_id = '$rootpage_id', page_order = '$page_order', page_name = '$page_name', page_description = '$page_description', meta_keywords = '$meta_keywords', meta_description = '$meta_description', header_img = '$header_img', status = '$status', modified = '$today' where id = '$page_id'"); } else { $rootpage_explode = explode('=',$rootpage_id); $rootpage_id = $rootpage_explode[3]; $sql = ("update page_sub set rootpage_id = '$rootpage_id', mainpage_id = '$mainpage_id', page_order = '$page_order', page_name = '$page_name', page_description = '$page_description', meta_keywords = '$meta_keywords', meta_description = '$meta_description', header_img = '$header_img', status = '$status', modified = '$today' where id = '$page_id'"); } $result = mysql_query($sql); $_SESSION['msg'] = '<div class="alert alert-success text-center"><strong>The page info. has been updated successfully.</strong></div>'; header("location: ../edit-page?id=$page_id&page=$page_type"); ?> <?php ob_flush(); ?>
Liking