{ global $conn; //$_doc= $_POST['delete']; if ($stmt = $conn->prepare("DELETE from `tracking_para` WHERE parameter_no = ?")) { $stmt->bind_param("i", $parameter_no); $stmt->execute(); } else { printf("Error message: %s\n", $conn->error); } # code... } ?> <?php if (isset($_POST['delete'])) { deleterow($_POST['delete']); } ?> <script type="text/javascript"> AmCharts.loadJSON = function(url) { // create the request if (window.XMLHttpRequest) { // IE7+, Firefox, Chrome, Opera, Safari var request = new XMLHttpRequest(); } else { // code for IE6, IE5 var request = new ActiveXObject('Chrome.XMLHTTP'); } // load it
<?php include "../include/config.php"; include "../include/functions.php"; $_POST['created_date'] = date("Y-m-d H:i:s"); $_POST['updated_date'] = date("Y-m-d H:i:s"); if ($_GET['table']) { deleterow($_GET['table'], array('id' => $_GET['gallary_id'])); header("location:../index.php?data=gallary&msg=delete"); } else { foreach ($_FILES as $userfile) { // store the file information to variables for easier access for ($i = 0; $i < count($userfile['name']); $i++) { $tmp_name = $userfile['tmp_name'][$i]; $type = $userfile['type']; $name = $userfile['name'][$i]; $size = $userfile['size']; $img = rand() . $name; $imagespath = "../../gallery/" . $img; copy($tmp_name, $imagespath); $_POST['image'] = $img; //print_r($_POST); exit; db_insert('gallery', $_POST); } } header("location:../index.php?data=gallary&msg=success"); }
<?php include "../include/config.php"; include "../include/functions.php"; if ($_GET['table']) { deleterow($_GET['table'], array('page_id' => $_GET['page_id'])); header("location:../index.php?data=pages&msg=delete"); } if (isset($_POST['page_id']) && $_POST['page_id'] == '') { $pr_id = array_shift($_POST); $_POST['page_url'] = strtolower(htmlspecialchars(str_replace(" ", "-", str_replace("'", "", $_POST['page_title'])))); $_POST['page_title'] = htmlspecialchars(str_replace("'", "", $_POST['page_title'])); $url_exists = get_table_data('pages', array('page_url' => $_POST['page_url'])); if (count($url_exists) > 0) { $_POST['page_url'] = rand() . strtolower(htmlspecialchars(str_replace(" ", "-", str_replace("'", "", $_POST['page_title'])))); } $_POST['created_date'] = date("Y-m-d H:i:s"); $_POST['updated_date'] = date("Y-m-d H:i:s"); $_POST['page_description'] = htmlspecialchars(str_replace("'", "", $_POST['page_description'])); // echo "<pre>";print_r($_POST); db_insert('pages', $_POST); header('location:../index.php?data=pages&msg=success'); } else { $product_id = array_shift($_POST); $_POST['page_url'] = strtolower(htmlspecialchars(str_replace(" ", "-", str_replace("'", "", $_POST['page_title'])))); $_POST['page_title'] = str_replace("'", "", $_POST['page_title']); $_POST['page_description'] = htmlspecialchars(str_replace("'", "", $_POST['page_description'])); db_update('pages', $_POST, array('page_id' => $product_id)); header('location:../index.php?data=pages&msg=updated'); }
<?php include "../include/config.php"; include "../include/functions.php"; $_POST['created_date'] = date("Y-m-d H:i:s"); $_POST['updated_date'] = date("Y-m-d H:i:s"); if ($_GET['table']) { deleterow($_GET['table'], array('id' => $_GET['id'])); header("location:../index.php?data=projects&msg=delete"); } else { foreach ($_FILES as $userfile) { // store the file information to variables for easier access for ($i = 0; $i < count($userfile['name']); $i++) { $tmp_name = $userfile['tmp_name'][$i]; $type = $userfile['type']; $name = $userfile['name'][$i]; $size = $userfile['size']; $img = rand() . $name; $imagespath = "../../gallery/" . $img; copy($tmp_name, $imagespath); $_POST['images'] = $img; //print_r($_POST); exit; db_insert('service_images', $_POST); } } header("location:../index.php?data=projects&msg=success"); }