ruạṛ
<?php session_start(); require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/universal.php'; $connID = connect_to_db(); $ship_id = is_numeric_id($_POST['ship_id']); $location = clean_plain_data($_POST['location']); $shipping_cost = clean_plain_data($_POST['shipping_cost']); $active = ($_POST['active']) ? 1 : 0; //validate $message = ''; if($location == ''){ $message .= 'Please enter a location. <br />';} if($shipping_cost == ''){ $message .= 'Please enter a shipping cost. <br />';} /* @todo validate cost as $ */ if($message != '') { getout($message); exit; } //insert if(!$update = mysql_query("update shipping set location = '$location' , shipping_cost = '$shipping_cost' , active = '$active' where ship_id = '$ship_id'")) { getout('There was an error updating the entry.'.mysql_error()); // exit; } $message = 'Entry updated successfully.'; /** * return to previous page */ getout($message,'../shipping.php'); exit; ?>
cải xoăn